[web] properly redirect when user login on loggedout view (closes #1954050)
This avoid getting a "you've no access to this view" message
--- a/web/views/sessions.py Mon Sep 26 09:31:54 2011 +0200
+++ b/web/views/sessions.py Fri Sep 23 12:17:12 2011 +0200
@@ -99,10 +99,10 @@
for forminternal_key in ('__form_id', '__domid', '__errorurl'):
args.pop(forminternal_key, None)
path = req.relative_path(False)
- if path == 'login':
+ if path in ('login', 'logout') or req.form.get('vid') == 'loggedout':
path = 'view'
args['__message'] = req._('welcome %s !') % req.user.login
- if 'vid' in req.form:
+ if 'vid' in req.form and req.form['vid'] != 'loggedout':
args['vid'] = req.form['vid']
if 'rql' in req.form:
args['rql'] = req.form['rql']