# HG changeset patch # User Pierre-Yves David # Date 1332264504 -3600 # Node ID 75694a61f0896ce5e01e58723d8dfd6b1d9ee5c7 # Parent fe60a77ae4a7c5b2af92dddbd1610d7ab07afbd5 [login redirect] only add postlogin_path argument when meaningful diff -r fe60a77ae4a7 -r 75694a61f089 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):