diff options
| author | Martin Trigaux <mat@odoo.com> | 2019-08-06 15:07:41 +0000 |
|---|---|---|
| committer | Martin Trigaux <mat@odoo.com> | 2019-08-07 13:06:17 +0000 |
| commit | 85ee046b37c7c9a0dc7f052b8258f81774b127de (patch) | |
| tree | 9a7da9025a665ffc52dff9849af4dc9d69e8892d /addons/auth_signup/controllers | |
| parent | f5cd483216af01001f44a41f7d48f042b9f56ff9 (diff) | |
[IMP] *: use res.lang methods
get_installed and _lang_get_id are both ormcached and correctly check
the context
Retrieving a res.lang from a code is a frequent action that can be
achieved with _lang_get (cf previous commit).
Using _lang_get ensure the active_test in the context is correct and
is not poluted with another context propagation issue.
odoo/odoo#35490 discussion is an example of bad context propagation
closes odoo/odoo#35504
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
Diffstat (limited to 'addons/auth_signup/controllers')
| -rw-r--r-- | addons/auth_signup/controllers/main.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/auth_signup/controllers/main.py b/addons/auth_signup/controllers/main.py index da2db6041db..0618cd367f3 100644 --- a/addons/auth_signup/controllers/main.py +++ b/addons/auth_signup/controllers/main.py @@ -123,7 +123,7 @@ class AuthSignupHome(Home): raise UserError(_("The form was not properly filled in.")) if values.get('password') != qcontext.get('confirm_password'): raise UserError(_("Passwords do not match; please retype them.")) - supported_langs = [lang['code'] for lang in request.env['res.lang'].sudo().search_read([], ['code'])] + supported_langs = [code for code, _ in request.env['res.lang'].get_installed()] if request.lang in supported_langs: values['lang'] = request.lang self._signup_with_values(qcontext.get('token'), values) |
