@@ -38,8 +38,9 @@ def validate(self, password, user=None):
38
38
def get_help_text (self ):
39
39
return _ (
40
40
'Your password must contain at least %(min_count)d uppercase '
41
- 'letter.' if self .min_count == 1 else
42
- 'Your password must contain at least %(min_count)d uppercase '
41
+ 'letter.'
42
+ if self .min_count == 1
43
+ else 'Your password must contain at least %(min_count)d uppercase '
43
44
'letters.' ,
44
45
) % {
45
46
'min_count' : self .min_count ,
@@ -79,8 +80,9 @@ def validate(self, password, user=None):
79
80
def get_help_text (self ):
80
81
return _ (
81
82
'Your password must contain at least %(min_count)d lowercase '
82
- 'letter.' if self .min_count == 1 else
83
- 'Your password must contain at least %(min_count)d lowercase '
83
+ 'letter.'
84
+ if self .min_count == 1
85
+ else 'Your password must contain at least %(min_count)d lowercase '
84
86
'letters.' ,
85
87
) % {
86
88
'min_count' : self .min_count ,
@@ -115,8 +117,8 @@ def validate(self, password, user=None):
115
117
def get_help_text (self ):
116
118
return _ (
117
119
'Your password must contain at least %(min_count)d digit.'
118
- if self .min_count == 1 else
119
- 'Your password must contain at least %(min_count)d digits.' ,
120
+ if self .min_count == 1
121
+ else 'Your password must contain at least %(min_count)d digits.' ,
120
122
) % {
121
123
'min_count' : self .min_count ,
122
124
}
@@ -128,9 +130,7 @@ class SpecialCharacterValidator:
128
130
characters.
129
131
"""
130
132
131
- DEFAULT_SPECIAL_CHARS = (
132
- r'[!@#$%^&*()_+\-\=\[\]{};\':",./<>?`~\\]'
133
- )
133
+ DEFAULT_SPECIAL_CHARS = r'[!@#$%^&*()_+\-\=\[\]{};\':",./<>?`~\\]'
134
134
135
135
def __init__ (self , min_count = 1 , special_chars = None ):
136
136
self .min_count = min_count
@@ -158,8 +158,9 @@ def validate(self, password, user=None):
158
158
def get_help_text (self ):
159
159
return _ (
160
160
'Your password must contain at least %(min_count)d special '
161
- 'character.' if self .min_count == 1 else
162
- 'Your password must contain at least %(min_count)d special '
161
+ 'character.'
162
+ if self .min_count == 1
163
+ else 'Your password must contain at least %(min_count)d special '
163
164
'characters.' ,
164
165
) % {
165
166
'min_count' : self .min_count ,
@@ -186,4 +187,3 @@ def get_help_text(self):
186
187
'Your password must only contain standard English letters, '
187
188
'digits, and symbols.' ,
188
189
)
189
-
0 commit comments