[FIX] website: prevent /web/become route to crash
Since 9f82605df1, any call to `_login_redirect()` without previously going
through `web_login()` method would crash, as `login_success` is set there.
In this case, it was:
Dispatch -> web_login -> redirect (new dispatch) -> _login_redirect()
task-2340941
closes odoo/odoo#57881
X-original-commit: 448fcb3c702c3346ca5af922bbf457231a7330f5
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
This commit is contained in:
@@ -99,7 +99,7 @@ class Website(Home):
|
||||
""" Redirect regular users (employees) to the backend) and others to
|
||||
the frontend
|
||||
"""
|
||||
if not redirect and request.params['login_success']:
|
||||
if not redirect and request.params.get('login_success'):
|
||||
if request.env['res.users'].browse(uid).has_group('base.group_user'):
|
||||
redirect = b'/web?' + request.httprequest.query_string
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user