On May 30, 2007, at 6:31 AM, [EMAIL PROTECTED] wrote:
> > 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... This was a bug in only trunk, I just fixed it in r2014. 0.9.5-release uses the httpexceptions middleware, and doesn't have this problem. Whereas trunk doesn't require it and handles converting the HTTPExceptions itself. Thanks for pointing this out -- Philip Jenvey --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "pylons-discuss" group. To post to this group, send email to pylons-discuss@googlegroups.com 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 -~----------~----~----~----~------~----~------~--~---