Commit 0ddb4ae0fdabcb77664fa0204150e075e1c36fb2
1 parent
2d49afc0
Exists in
master
and in
3 other branches
Removing password mask
Showing
1 changed file
with
18 additions
and
18 deletions
Show diff stats
users/forms.py
@@ -34,33 +34,33 @@ class Validation(forms.ModelForm): | @@ -34,33 +34,33 @@ class Validation(forms.ModelForm): | ||
34 | 34 | ||
35 | return image | 35 | return image |
36 | 36 | ||
37 | - def clean_new_password(self): | ||
38 | - password = self.cleaned_data.get('new_password') | ||
39 | - print(self.cleaned_data) | ||
40 | - if self.is_edit and len(password) == 0: | ||
41 | - return password | ||
42 | - | ||
43 | - # At least MIN_LENGTH long | ||
44 | - if len(password) < self.MIN_PASS_LENGTH: | ||
45 | - self._errors['new_password'] = [_("The new password must contain at least % d characters." % self.MIN_PASS_LENGTH)] | 37 | + # def clean_new_password(self): |
38 | + # password = self.cleaned_data.get('new_password') | ||
39 | + | ||
40 | + # if self.is_edit and len(password) == 0: | ||
41 | + # return password | ||
42 | + | ||
43 | + # # At least MIN_LENGTH long | ||
44 | + # if len(password) < self.MIN_PASS_LENGTH: | ||
45 | + # self._errors['new_password'] = [_("The new password must contain at least % d characters." % self.MIN_PASS_LENGTH)] | ||
46 | 46 | ||
47 | - return ValueError | 47 | + # return ValueError |
48 | 48 | ||
49 | - # At least one letter and one non-letter | ||
50 | - first_isalpha = password[0].isalpha() | ||
51 | - if all(c.isalpha() == first_isalpha for c in password): | ||
52 | - self._errors['new_password'] = [_('The password must contain at least one letter and at least one digit or a punctuation character.')] | 49 | + # # At least one letter and one non-letter |
50 | + # first_isalpha = password[0].isalpha() | ||
51 | + # if all(c.isalpha() == first_isalpha for c in password): | ||
52 | + # self._errors['new_password'] = [_('The password must contain at least one letter and at least one digit or a punctuation character.')] | ||
53 | 53 | ||
54 | - return ValueError | 54 | + # return ValueError |
55 | 55 | ||
56 | - return password | 56 | + # return password |
57 | 57 | ||
58 | def clean_password2(self): | 58 | def clean_password2(self): |
59 | password = self.cleaned_data.get("new_password") | 59 | password = self.cleaned_data.get("new_password") |
60 | password2 = self.cleaned_data.get("password2") | 60 | password2 = self.cleaned_data.get("password2") |
61 | 61 | ||
62 | - if self.is_edit and len(password) == 0: | ||
63 | - return password2 | 62 | + #if self.is_edit and len(password) == 0: |
63 | + # return password2 | ||
64 | 64 | ||
65 | if password and password2 and password != password2: | 65 | if password and password2 and password != password2: |
66 | self._errors['password2'] = [_('The confirmation password is incorrect.')] | 66 | self._errors['password2'] = [_('The confirmation password is incorrect.')] |