mirror of
https://github.com/django/django.git
synced 2025-11-07 07:15:35 +00:00
Fixed #27467 -- Made UserAttributeSimilarityValidator max_similarity=0/1 work as documented.
Thanks goblinJoel for the report and feedback.
This commit is contained in:
@@ -147,7 +147,7 @@ class UserAttributeSimilarityValidator(object):
|
||||
continue
|
||||
value_parts = re.split(r'\W+', value) + [value]
|
||||
for value_part in value_parts:
|
||||
if SequenceMatcher(a=password.lower(), b=value_part.lower()).quick_ratio() > self.max_similarity:
|
||||
if SequenceMatcher(a=password.lower(), b=value_part.lower()).quick_ratio() >= self.max_similarity:
|
||||
try:
|
||||
verbose_name = force_text(user._meta.get_field(attribute_name).verbose_name)
|
||||
except FieldDoesNotExist:
|
||||
|
||||
Reference in New Issue
Block a user