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

Oliver Bleutgen myzope@gmx.net
Wed, 11 Jun 2003 18:12:49 +0200


Dieter Maurer wrote:
> Oliver Bleutgen wrote at 2003-6-10 14:54 +0200:
>  > ...
>  > (*) 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?
> 
> It probably a bug. But one, that usually only adds an unnecessary
> "redirect".

Usually, but not when m.find('/') == 0, which OTOH happens if you want 
to give nice, secure absolute paths to the methods.
The attribute error you get in that case is quite irritating.

I'll stick it in the collectior.


thanks,
oliver