From a5b65856844b29723487336f635d36d1d8ec51af Mon Sep 17 00:00:00 2001 From: root Date: Mon, 27 Feb 2023 17:44:36 +0300 Subject: [PATCH] =?UTF-8?q?Fix:=20=D0=B8=D0=B7=D0=BC=D0=B5=D0=BD=D0=B5?= =?UTF-8?q?=D0=BD=D0=B8=D0=B5=20=D1=82=D0=B5=D0=BA=D1=81=D1=82=D0=B0=20?= =?UTF-8?q?=D0=BD=D0=B5=D0=BD=D0=B0=D0=B4=D0=B5=D0=B6=D0=BD=D0=BE=D0=B3?= =?UTF-8?q?=D0=BE=20=D0=BF=D0=B0=D1=80=D0=BE=D0=BB=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pym/client/variables/client.py | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/pym/client/variables/client.py b/pym/client/variables/client.py index 4239c01..389c909 100644 --- a/pym/client/variables/client.py +++ b/pym/client/variables/client.py @@ -280,14 +280,11 @@ class VariableUrUserNewPw(Variable): def check(self, value): if not value: raise VariableError(_("Empty password")) - if len(value) < 8: - raise VariableError(_("Password should contain at least 8 symbols")) - elif not any([x.isupper() for x in value]): - raise VariableError(_("Password should contain at least 1 uppercase letter")) - elif not any([x.islower() for x in value]): - raise VariableError(_("Password should contain at least 1 lowercase letter")) - elif not any([x.isdigit() for x in value]): - raise VariableError(_("Password should contain at least 1 digit")) + if not all([len(value) > 7, + any([x.isupper() for x in value]), + any([x.islower() for x in value]), + any([x.isdigit() for x in value])]): + raise VariableError(_("Password should contain at least 8 symbols, 1 uppercase letter, 1 lowercase letter, 1 digit")) class VariableClClientLogin(user.VariableUrLogin):