Add module prefix to "password same as" messages

issue9661
review298731002
This commit is contained in:
Cédric Krier committed 2020-10-08 21:31:49 +02:00
1 parent 576b6265a6
commit 321461647e
1 file changed
+3 -3
+3 -3
View File
@@ -274,9 +274,9 @@ class User(DeactivableMixin, ModelSQL, ModelView):
for user in users:
# Use getattr to allow to use non User instances
for test, message in [
(getattr(user, 'name', ''), 'msg_password_name'),
(getattr(user, 'login', ''), 'msg_password_login'),
(getattr(user, 'email', ''), 'msg_password_email'),
(getattr(user, 'name', ''), 'res.msg_password_name'),
(getattr(user, 'login', ''), 'res.msg_password_login'),
(getattr(user, 'email', ''), 'res.msg_password_email'),
]:
if test and password.lower() == test.lower():
raise PasswordError(gettext(message))