Skip to content

Commit

Permalink
ZXCVBNValidator error message fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Telonor authored and Telonor committed Mar 30, 2016
1 parent abde5aa commit b3a5583
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 11 deletions.
Binary file modified django_zxcvbn/locale/ru/LC_MESSAGES/django.mo
Binary file not shown.
13 changes: 4 additions & 9 deletions django_zxcvbn/locale/ru/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-03-29 15:56+0300\n"
"POT-Creation-Date: 2016-03-30 13:17+0300\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
Expand All @@ -22,18 +22,13 @@ msgstr ""
#: validators.py:23
#, python-format
msgid "Must be %s characters or more"
msgstr "Должно содержать минимум %s символов"
msgstr "Должен содержать минимум %s символов"

#: validators.py:27
#, python-format
msgid "Must be %s characters or less"
msgstr "Должно содержать не более %s символов"
msgstr "Должен содержать не более %s символов"

#: validators.py:32
#, python-format
msgid "Passwords must be at least %s characters and of sufficient complexity"
msgstr "Пароль должен содержать минимум %s символов достаточной сложности"

#: validators.py:39
#: validators.py:38
msgid "Password is too weak"
msgstr "Пароль слишком слаб"
3 changes: 1 addition & 2 deletions django_zxcvbn/validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,13 @@ def __call__(self, value):


class ZXCVBNValidator(object):
message = _("Passwords must be at least %s characters and of sufficient complexity")
code = "zxcvbn"

def __call__(self,value):
res = zxcvbn.password_strength(value)
if res.get('entropy') < PASSWORD_MIN_ENTROPY:
raise ValidationError(
self.message % _("Password is too weak"),
_("Password is too weak"),
code=self.code)


Expand Down

0 comments on commit b3a5583

Please sign in to comment.