MCPcopy
hub / github.com/django/django / validate

Method validate

django/contrib/auth/password_validation.py:250–255  ·  view source on GitHub ↗
(self, password, user=None)

Source from the content-addressed store, hash-verified

248 self.passwords = {x.strip() for x in f}
249
250 def validate(self, password, user=None):
251 if password.lower().strip() in self.passwords:
252 raise ValidationError(
253 self.get_error_message(),
254 code="password_too_common",
255 )
256
257 def get_error_message(self):
258 return _("This password is too common.")

Callers 1

Calls 2

get_error_messageMethod · 0.95
ValidationErrorClass · 0.90

Tested by 1