Skip to content

Commit

Permalink
Black and some pylint
Browse files Browse the repository at this point in the history
  • Loading branch information
faucomte97 committed Jan 30, 2024
1 parent c7b0f5b commit 25ada39
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
6 changes: 3 additions & 3 deletions codeforlife/user/auth/password_validators/independent.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,18 @@ def validate(self, password, user=None):

if not re.search(r"[A-Z]", password):
raise ValidationError(
_(f"Your password must have at least 1 uppercase letter."),
_("Your password must have at least 1 uppercase letter."),
code="password_no_uppercase",
)

if not re.search(r"[a-z]", password):
raise ValidationError(
_(f"Your password must have at least 1 lowercase letter."),
_("Your password must have at least 1 lowercase letter."),
code="password_no_lowercase",
)

if not re.search(r"[0-9]", password):
raise ValidationError(
_(f"Your password must have at least 1 digit."),
_("Your password must have at least 1 digit."),
code="password_no_digit",
)
9 changes: 4 additions & 5 deletions codeforlife/user/auth/password_validators/teacher.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,27 +28,26 @@ def validate(self, password, user=None):

if not re.search(r"[A-Z]", password):
raise ValidationError(
_(f"Your password must have at least 1 uppercase letter."),
_("Your password must have at least 1 uppercase letter."),
code="password_no_uppercase",
)

if not re.search(r"[a-z]", password):
raise ValidationError(
_(f"Your password must have at least 1 lowercase letter."),
_("Your password must have at least 1 lowercase letter."),
code="password_no_lowercase",
)

if not re.search(r"[0-9]", password):
raise ValidationError(
_(f"Your password must have at least 1 digit."),
_("Your password must have at least 1 digit."),
code="password_no_digit",
)

if not re.search(
r"[!@#$%^&*()_+\-=\[\]{};':\"\\|,.<>\/?]", password
):
raise ValidationError(
_(f"Your password must have at least 1 special "
f"character."),
_("Your password must have at least 1 special character."),
code="password_no_special_character",
)

0 comments on commit 25ada39

Please sign in to comment.