AdminAuthenticationForm
A custom authentication form used in the admin app.
Attributes
| Attribute | Type | Description |
|---|---|---|
| error_messages | dict | A dictionary of error messages used to override the default login failure text with a specific message requiring staff account credentials. |
| required_css_class | string = "required" | The CSS class name applied to form field widgets that are marked as mandatory for successful form validation. |
Constructor
Signature
def AdminAuthenticationForm()
Methods
confirm_login_allowed()
@classmethod
def confirm_login_allowed(
user: [User](../../auth/models/user.md?sid=django_contrib_auth_models_user)
) - > null
Validates that the authenticated user has staff privileges required to access the admin interface.
Parameters
| Name | Type | Description |
|---|---|---|
| user | [User](../../auth/models/user.md?sid=django_contrib_auth_models_user) | The user object representing the account attempting to authenticate. |
Returns
| Type | Description |
|---|---|
null | Nothing if the user is permitted to log in; otherwise, a ValidationError is raised. |