MCPcopy
hub / github.com/django/django / clean_old_password

Method clean_old_password

django/contrib/auth/forms.py:537–547  ·  view source on GitHub ↗

Validate that the old_password field is correct.

(self)

Source from the content-addressed store, hash-verified

535
536 @sensitive_variables("old_password")
537 def clean_old_password(self):
538 """
539 Validate that the old_password field is correct.
540 """
541 old_password = self.cleaned_data["old_password"]
542 if not self.user.check_password(old_password):
543 raise ValidationError(
544 self.error_messages["password_incorrect"],
545 code="password_incorrect",
546 )
547 return old_password
548
549
550class AdminPasswordChangeForm(SetUnusablePasswordMixin, SetPasswordMixin, forms.Form):

Calls 2

ValidationErrorClass · 0.90
check_passwordMethod · 0.45