diff options
| author | Romain Derie <rde@odoo.com> | 2019-03-26 05:56:55 +0000 |
|---|---|---|
| committer | Romain Derie <rde@odoo.com> | 2019-08-26 16:35:19 +0000 |
| commit | 269aa594111a152ad4b7714856ea745bfef57155 (patch) | |
| tree | d5f8f7e86209102d831b2e222038d45bd7fe7626 /addons/auth_signup/controllers | |
| parent | f10f120de3017bc8d0e9a5ac72eeec1280374a1d (diff) | |
[IMP] http_routing, website: allow to customize the lang in URL
With this commit it is now possible to change the lang displayed in the URL.
Eg, you could use `/fr` instead of `/fr_BE`, or even a fancier `/french`.
Task-32838
Courtesy of pla@odoo.com
closes odoo/odoo#35135
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
Diffstat (limited to 'addons/auth_signup/controllers')
| -rw-r--r-- | addons/auth_signup/controllers/main.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/addons/auth_signup/controllers/main.py b/addons/auth_signup/controllers/main.py index 0618cd367f3..6f21118e369 100644 --- a/addons/auth_signup/controllers/main.py +++ b/addons/auth_signup/controllers/main.py @@ -123,9 +123,9 @@ 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 = [code for code, _ in request.env['res.lang'].get_installed()] - if request.lang in supported_langs: - values['lang'] = request.lang + supported_lang_codes = [code for code, _ in request.env['res.lang'].get_installed()] + if request.lang.code in supported_lang_codes: + values['lang'] = request.lang.code self._signup_with_values(qcontext.get('token'), values) request.env.cr.commit() |
