[login redirect] only add postlogin_path argument when meaningful
authorPierre-Yves David <pierre-yves.david@logilab.fr>
Tue, 20 Mar 2012 18:28:24 +0100
changeset 8324 75694a61f089
parent 8323 fe60a77ae4a7
child 8325 7f2337d7937f
[login redirect] only add postlogin_path argument when meaningful
web/views/basetemplates.py
--- a/web/views/basetemplates.py	Mon Mar 19 14:37:43 2012 +0100
+++ b/web/views/basetemplates.py	Tue Mar 20 18:28:24 2012 +0100
@@ -450,8 +450,10 @@
             # reuse existing redirection if it exist
             target = self._cw.form.get('postlogin_path',
                                        self._cw.relative_path())
-            return self._cw.build_url('login', __secure__=True,
-                                      postlogin_path=target)
+            url_args = {}
+            if target and target != '/':
+                url_args['postlogin_path'] = target
+            return self._cw.build_url('login', __secure__=True, **url_args)
         return super(LogForm, self).form_action()
 
 class LogForm(BaseLogForm):