Commit 5179dc0198ee6436b906992fb7d45e0a37a68441
Exists in
master
and in
3 other branches
Merge branch 'refactoring' of https://github.com/amadeusproject/amadeuslms into refactoring
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 | 34 | |
35 | 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 | 58 | def clean_password2(self): |
59 | 59 | password = self.cleaned_data.get("new_password") |
60 | 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 | 65 | if password and password2 and password != password2: |
66 | 66 | self._errors['password2'] = [_('The confirmation password is incorrect.')] | ... | ... |