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):