From a826d91015b8a2c53c529e153cdce3f2c96f7379 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Tue, 11 Apr 2023 00:08:28 +0200 Subject: [PATCH] Ensure reset password has at least the minimal length for password Closes #12028 --- trytond/trytond/res/user.py | 1 + 1 file changed, 1 insertion(+) diff --git a/trytond/trytond/res/user.py b/trytond/trytond/res/user.py index 19c8186bd0..0065f76cd4 100644 --- a/trytond/trytond/res/user.py +++ b/trytond/trytond/res/user.py @@ -306,6 +306,7 @@ class User(avatar_mixin(100, 'login'), DeactivableMixin, ModelSQL, ModelView): @classmethod @ModelView.button def reset_password(cls, users, length=8, from_=None): + length = max(length, config.getint('password', 'length', default=0)) for user in users: user.password_reset = gen_password(length=length) user.password_reset_expire = (