allow the __method() hook to raise a Redirect exception
authorAdrien Di Mascio <Adrien.DiMascio@logilab.fr>
Thu, 14 May 2009 16:32:20 +0200
changeset 1827 93840d187f26
parent 1825 0edb3b469eff
child 1831 01d7e413a538
allow the __method() hook to raise a Redirect exception
web/views/basecontrollers.py
--- a/web/views/basecontrollers.py	Thu May 14 16:28:58 2009 +0200
+++ b/web/views/basecontrollers.py	Thu May 14 16:32:20 2009 +0200
@@ -114,6 +114,8 @@
             try:
                 method = getattr(entity, req.form.pop('__method'))
                 method()
+            except Redirect: # propagate redirect that might occur in method()
+                raise
             except Exception, ex:
                 self.exception('while handling __method')
                 req.set_message(req._("error while handling __method: %s") % req._(ex))