Skip to content

Commit 2b936fa

Browse files
style: Format validators.py to comply with ruff
1 parent 1a8e040 commit 2b936fa

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

promo_code/promo_code/validators.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,9 @@ def validate(self, password, user=None):
3838
def get_help_text(self):
3939
return _(
4040
'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 '
4344
'letters.',
4445
) % {
4546
'min_count': self.min_count,
@@ -79,8 +80,9 @@ def validate(self, password, user=None):
7980
def get_help_text(self):
8081
return _(
8182
'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 '
8486
'letters.',
8587
) % {
8688
'min_count': self.min_count,
@@ -115,8 +117,8 @@ def validate(self, password, user=None):
115117
def get_help_text(self):
116118
return _(
117119
'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.',
120122
) % {
121123
'min_count': self.min_count,
122124
}
@@ -128,9 +130,7 @@ class SpecialCharacterValidator:
128130
characters.
129131
"""
130132

131-
DEFAULT_SPECIAL_CHARS = (
132-
r'[!@#$%^&*()_+\-\=\[\]{};\':",./<>?`~\\]'
133-
)
133+
DEFAULT_SPECIAL_CHARS = r'[!@#$%^&*()_+\-\=\[\]{};\':",./<>?`~\\]'
134134

135135
def __init__(self, min_count=1, special_chars=None):
136136
self.min_count = min_count
@@ -158,8 +158,9 @@ def validate(self, password, user=None):
158158
def get_help_text(self):
159159
return _(
160160
'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 '
163164
'characters.',
164165
) % {
165166
'min_count': self.min_count,
@@ -186,4 +187,3 @@ def get_help_text(self):
186187
'Your password must only contain standard English letters, '
187188
'digits, and symbols.',
188189
)
189-

0 commit comments

Comments
 (0)