[web] properly redirect when user login on loggedout view (closes #1954050) stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Fri, 23 Sep 2011 12:17:12 +0200
branchstable
changeset 7854 d95a76df33a9
parent 7853 69cbb780dc83
child 7855 54283a5b7afc
[web] properly redirect when user login on loggedout view (closes #1954050) This avoid getting a "you've no access to this view" message
web/views/sessions.py
--- 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']