[FIX] website: avoid redirect to website after login
When logged in a user was redirected to the website instead of the backend.
This was due to a wrong group verification, at that point:
- request.uid = ID of the user authenticating (e.g. admin)
- request.env.uid = ID of the user that rendered the page (public)
As public does not belong to `base.group_user` group, the user was redirected to
the website.
Introduced at fd09ddb6 during migration.
Fixes #13203
Closes #13204
This commit is contained in:
@@ -82,7 +82,7 @@ class Website(Home):
|
||||
def web_login(self, redirect=None, *args, **kw):
|
||||
response = super(Website, self).web_login(redirect=redirect, *args, **kw)
|
||||
if not redirect and request.params['login_success']:
|
||||
if request.env.user.has_group('base.group_user'):
|
||||
if request.env['res.users'].browse(request.uid).has_group('base.group_user'):
|
||||
redirect = '/web?' + request.httprequest.query_string
|
||||
else:
|
||||
redirect = '/'
|
||||
|
||||
Reference in New Issue
Block a user