[web login] fix after login redirection: redirect expect an url not a relative path. Breaks on cases like '?vid=aview'. Closes #2423575
--- a/web/views/basecontrollers.py Fri Jul 20 10:57:48 2012 +0200
+++ b/web/views/basecontrollers.py Fri Jul 20 11:31:34 2012 +0200
@@ -91,7 +91,9 @@
def publish(self, rset=None):
"""log in the instance"""
path = self._cw.form.get('postlogin_path', '.')
- raise Redirect(path)
+ # redirect expect an url, not a path. Also path may contains a query
+ # string, hence should not be given to _cw.build_url()
+ raise Redirect(self._cw.base_url() + path)
class LogoutController(Controller):
--- a/web/views/basetemplates.py Fri Jul 20 10:57:48 2012 +0200
+++ b/web/views/basetemplates.py Fri Jul 20 11:31:34 2012 +0200
@@ -449,7 +449,7 @@
def form_action(self):
if self.action is None:
- # reuse existing redirection if it exist
+ # reuse existing redirection if it exists
target = self._cw.form.get('postlogin_path',
self._cw.relative_path())
url_args = {}