Skip to content

Commit ce8ab8f

Browse files
committed
Add missing get_help_text methods to all validators.
1 parent 6597e25 commit ce8ab8f

File tree

4 files changed

+19
-1
lines changed

4 files changed

+19
-1
lines changed

django_pwned/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "1.2.1"
1+
__version__ = "1.2.2"
232 Bytes
Binary file not shown.

django_pwned/locale/fa/LC_MESSAGES/django.po

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,7 @@ msgstr ""
3737
#: validators.py
3838
msgid "Make sure password has at least %(min_unique_characters)d unique characters."
3939
msgstr "گذرواژه باید حداقل %(min_unique_characters)d کاراکتر متمایز داشته باشد."
40+
41+
#: validators.py
42+
msgid "Your password should contain at least %(min_unique_characters)d unique characters."
43+
msgstr "گذرواژه شما باید حداقل %(min_unique_characters)d کاراکتر متمایز داشته باشد."

django_pwned/validators.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,13 @@ def validate(self, password: str, user=None):
7676
code="password_github_like_validator",
7777
)
7878

79+
def get_help_text(self):
80+
return (
81+
_("Passwords shorter than %(safe_length)d characters must include a number and a lowercase letter.") % {
82+
"safe_length": self.safe_length
83+
}
84+
)
85+
7986

8087
class MinimumUniqueCharactersPasswordValidator:
8188
"""
@@ -96,3 +103,10 @@ def validate(self, password: str, user=None):
96103
% {"min_unique_characters": self.min_unique_characters},
97104
code="password_min_unique_characters_validator",
98105
)
106+
107+
def get_help_text(self):
108+
return (
109+
_("Your password should contain at least %(min_unique_characters)d unique characters.") % {
110+
"min_unique_characters": self.min_unique_characters
111+
}
112+
)

0 commit comments

Comments
 (0)