MCPcopy
hub / github.com/django/django / __init__

Method __init__

django/contrib/auth/forms.py:562–573  ·  view source on GitHub ↗
(self, user, *args, **kwargs)

Source from the content-addressed store, hash-verified

560 password1, password2 = SetPasswordMixin.create_password_fields()
561
562 def __init__(self, user, *args, **kwargs):
563 self.user = user
564 super().__init__(*args, **kwargs)
565 self.fields["password1"].widget.attrs["autofocus"] = True
566 if self.user.has_usable_password():
567 self.fields["password1"].required = False
568 self.fields["password2"].required = False
569 self.fields["usable_password"] = (
570 SetUnusablePasswordMixin.create_usable_password_field(
571 self.usable_password_help_text
572 )
573 )
574
575 def clean(self):
576 self.validate_passwords()

Callers

nothing calls this directly

Calls 3

has_usable_passwordMethod · 0.80
__init__Method · 0.45

Tested by

no test coverage detected