From 814eae1fbd27aad056694b2c303dca398025f39d Mon Sep 17 00:00:00 2001 From: Aristobulo Meneses Date: Thu, 18 Aug 2016 16:04:18 +0200 Subject: [PATCH] [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 --- addons/website/controllers/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/website/controllers/main.py b/addons/website/controllers/main.py index b12274d4b09..0826ac839d7 100644 --- a/addons/website/controllers/main.py +++ b/addons/website/controllers/main.py @@ -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 = '/'