remove #<formid> from url used to redirect after a validation error stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Wed, 24 Feb 2010 10:37:37 +0100
branchstable
changeset 4679 d8ad65dab3e9
parent 4678 45661175f1da
child 4680 8a6bee838464
remove #<formid> from url used to redirect after a validation error
web/application.py
--- a/web/application.py	Wed Feb 24 10:35:06 2010 +0100
+++ b/web/application.py	Wed Feb 24 10:37:37 2010 +0100
@@ -381,7 +381,11 @@
                         'eidmap': req.data.get('eidmap', {})
                         }
             req.set_session_data(req.form['__errorurl'], forminfo)
-            raise Redirect(req.form['__errorurl'])
+            # XXX form session key / __error_url should be differentiated:
+            # session key is 'url + #<form dom id', though we usually don't want
+            # the browser to move to the form since it hides the global
+            # messages.
+            raise Redirect(req.form['__errorurl'].rsplit('#', 1)[0])
         self.error_handler(req, ex, tb=False)
 
     def error_handler(self, req, ex, tb=False):