From 3299c91b38511841f0a1fb8dc18f417cbd30f834 Mon Sep 17 00:00:00 2001 From: root Date: Tue, 6 Dec 2022 11:57:54 +0300 Subject: [PATCH] TG-4 --- pym/client/variables/client.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pym/client/variables/client.py b/pym/client/variables/client.py index 5a03d2f..8a5cb0e 100644 --- a/pym/client/variables/client.py +++ b/pym/client/variables/client.py @@ -280,6 +280,14 @@ 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")) class VariableClClientLogin(user.VariableUrLogin):