diff options
| author | Lucas Lefèvre <lul@odoo.com> | 2019-10-07 11:57:56 +0000 |
|---|---|---|
| committer | fw-bot <otis@odoo.com> | 2019-10-14 16:30:38 +0000 |
| commit | d133df581964b0dab95eb92d8fd79227488b79de (patch) | |
| tree | 530967a5cc38a69c72bf85432138a63c54e818bd /addons/website/tests/__init__.py | |
| parent | 8c15358e815fb4a9af4d8cc9961fd475ee54290f (diff) | |
[FIX] website: Display duplicate login error message
When you try to create two users with the same login, the shown error message is
the Postgresql integrity error instead of a nice (translated) validation error.
This happens since bf88f3e which changed the way error messages are translated.
The reason is the manually created unique index `res_users_login_key_unique_website_index`.
The error handling and translation mechanisms don't know it exists.
The index was created for performance reasons in commit b5a12b4 where the
original python constraint was replaced with this custom SQL index.
In this commit, the python constraint is re-introduced to remove the index hack,
but the implementation now uses a single SQL query, which should be quite fast.
closes odoo/odoo#38737
X-original-commit: 817a811ec98b0c313b12e6464b5e98ca432cb3fc
Signed-off-by: Christophe Simonis <chs@odoo.com>
Diffstat (limited to 'addons/website/tests/__init__.py')
| -rw-r--r-- | addons/website/tests/__init__.py | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/addons/website/tests/__init__.py b/addons/website/tests/__init__.py index 9bb3efd60de..bab3d80edb0 100644 --- a/addons/website/tests/__init__.py +++ b/addons/website/tests/__init__.py @@ -9,6 +9,7 @@ from . import test_lang_url from . import test_menu from . import test_page from . import test_qweb +from . import test_res_users from . import test_ui from . import test_views from . import test_website_favicon |
