I was trying to do a redirect_to call in the __before__ method a
controller. Pylons isn't catching the HTTPFound exception and doing
the redirect.
in pylons/controllers.py : in both the Controller and the
WSGIController classes
if hasattr(self, '__before__'):
self._inspect_call(self.__before__, **kargs)
try:
response = self._dispatch_call()
except HTTPException, httpe:
response = httpe.response(environ)
if hasattr(self, '__after__'):
self.response = response
self._inspect_call(self.__after__)
return response
the __before__ call is outside of the try:. Is there any particular
reason for this? Should I not be redirecting from a __before__ method?
Would it make sense to move the call to __before__ inside the try? I
made the change and it seemed to work...
Thanks,
Mike
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"pylons-discuss" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/pylons-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---