[Zope-dev] what is manage_workspace supposed to do?

Oliver Bleutgen myzope@gmx.net
Tue, 10 Jun 2003 14:54:29 +0200


I've a problem with a product I'm writing and the way manage_workspace 
works.
There's this code in App/Management.py:


def manage_workspace(self, REQUEST):
     """Dispatch to first interface in manage_options
     """
     options=self.filtered_manage_options(REQUEST)
     try:
         m=options[0]['action']
         if m=='manage_workspace': raise TypeError
     except:
         raise Unauthorized, (
             'You are not authorized to view this object.')
(*) if m.find('/'):
         raise 'Redirect', (
             "%s/%s" % (REQUEST['URL1'], m))
      return getattr(self, m)(self, REQUEST)

My question is about the marked block. I'd guess that the intent is to 
send a redirect if m (== options[0]['action']) contains a '/'.

But m.find('/') evaluates to false only if m[0] == '/', otherwise it 
yields either -1 (which is true), if there's no '/' in m, or something 
greater 0, if there's a slash after the first char.

Is this intended behavior or a bug?


cheers,
oliver