changeset 147e6bcfee80 in trytond:default
details: https://hg.tryton.org/trytond?cmd=changeset&node=147e6bcfee80
description:
Warn user about the minimal password length
issue10713
review344701002
diffstat:
trytond/res/message.xml | 2 +-
trytond/res/user.py | 4 +++-
2 files changed, 4 insertions(+), 2 deletions(-)
diffs (26 lines):
diff -r 9044da30abd2 -r 147e6bcfee80 trytond/res/message.xml
--- a/trytond/res/message.xml Thu Sep 23 10:12:01 2021 +0200
+++ b/trytond/res/message.xml Thu Sep 23 10:13:09 2021 +0200
@@ -4,7 +4,7 @@
<tryton>
<data grouped="1">
<record model="ir.message" id="msg_password_length">
- <field name="text">The password is too short.</field>
+ <field name="text">The password must have at least %(length)i
characters.</field>
</record>
<record model="ir.message" id="msg_password_forbidden">
<field name="text">The password is forbidden.</field>
diff -r 9044da30abd2 -r 147e6bcfee80 trytond/res/user.py
--- a/trytond/res/user.py Thu Sep 23 10:12:01 2021 +0200
+++ b/trytond/res/user.py Thu Sep 23 10:13:09 2021 +0200
@@ -285,7 +285,9 @@
length = config.getint('password', 'length', default=0)
if length > 0:
if len(password_b) < length:
- raise PasswordError(gettext('res.msg_password_length'))
+ raise PasswordError(gettext('res.msg_password_length', {
+ 'length': length,
+ }))
path = config.get('password', 'forbidden', default=None)
if path:
with open(path, 'r') as f: