Opened 6 years ago

Closed 6 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 Oskar Haller)

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 Oskar Haller, 6 years ago

Description: modified (diff)

comment:2 by Tim Graham, 6 years ago

Component: Uncategorizedcontrib.auth
Resolution: invalid
Status: newclosed

AuthenticationForm isn't a model form. Please use TicketClosingReasons/UseSupportChannels to ask questions and confirm a bug before create a ticket.

Note: See TracTickets for help on using tickets.
Back to Top