Opened 7 years ago
Closed 7 years ago
#30164 closed Bug (invalid)
Changing attributes in the default Authentication Form
| Reported by: | Oskar Haller | Owned by: | nobody |
|---|---|---|---|
| Component: | contrib.auth | Version: | 2.1 |
| Severity: | Normal | Keywords: | Authentication Form |
| Cc: | Triage Stage: | Unreviewed | |
| Has patch: | no | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description (last modified by )
The following code works
class LoginForm(AuthenticationForm):
"""
adds helptext to authentication
"""
def __init__(self, *args, **kwargs):
super(LoginForm, self).__init__(*args, **kwargs)
self.fields['username'].help_text = _("Enter your E-Mail address")
self.fields['password'].help_text = _("Enter your password")
However, from this documentation https://docs.djangoproject.com/en/2.1/topics/forms/modelforms/#modelforms-overriding-default-fields I would have guessed that I could simply specify those elements with a MetaClass. But that did not work.
Is that a bug or just something I'm not aware of?
Change History (2)
comment:1 by , 7 years ago
| Description: | modified (diff) |
|---|
comment:2 by , 7 years ago
| Component: | Uncategorized → contrib.auth |
|---|---|
| Resolution: | → invalid |
| Status: | new → closed |
Note:
See TracTickets
for help on using tickets.
AuthenticationFormisn't a model form. Please use TicketClosingReasons/UseSupportChannels to ask questions and confirm a bug before create a ticket.