From 828ea9c523c9e8dc7c6aa27979ceecb3da8dd7fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Theys?= Date: Tue, 29 Dec 2020 12:19:58 +0000 Subject: [PATCH] [FIX] auth_signup: properly grab user lang from context MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Follow up on d0a4b20d3660c09b1ebe203125d57c9a533c7957 The `lang` at this step is compared to the locale `code` (eg. fr_BE) so the split is a mistake. To reproduce the issue: - change the language of a website to fr_BE only - allow free signup - register as a new user Notice how the language of the user is set to en_US before this PR instead of fr_BE as it should be. closes #63616 closes odoo/odoo#64089 X-original-commit: ba21dadf17ba96ecbba917f666a3b385d9b9fd5e Signed-off-by: Sébastien Theys (seb) --- addons/auth_signup/controllers/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/auth_signup/controllers/main.py b/addons/auth_signup/controllers/main.py index 82219be6930..d4eb9ec7ec4 100644 --- a/addons/auth_signup/controllers/main.py +++ b/addons/auth_signup/controllers/main.py @@ -124,7 +124,7 @@ class AuthSignupHome(Home): if values.get('password') != qcontext.get('confirm_password'): raise UserError(_("Passwords do not match; please retype them.")) supported_lang_codes = [code for code, _ in request.env['res.lang'].get_installed()] - lang = request.context.get('lang', '').split('_')[0] + lang = request.context.get('lang', '') if lang in supported_lang_codes: values['lang'] = lang self._signup_with_values(qcontext.get('token'), values)