Opened 16 years ago

Closed 15 years ago

Last modified 14 years ago

#8274 closed (fixed)

Auth views should allow form customization

Reported by: Julien Phalip Owned by: Julien Phalip
Component: contrib.auth Version: dev
Severity: Keywords:
Cc: philipe.rp@…, Dave Naffziger, bthomas@…, Freark van der Bos, steph, graham@…, michel@…, ben@…, MonteDavidoff, bas@… Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

It is possible to make your own authentication backend. However, if you want to authenticate with usernames longer than 30 characters (e.g. emails) you cannot rely on the login view, since it's bound to use the AuthenticationForm, which itself only allows 30 characters usernames. You could easily find a way around if only the form was customizable.

Curiously, some views already allow form customization -- password_reset_confirm and password_reset -- but the others don't -- login and password_change --. The attached patch fixes the latter.

Attachments (2)

8274.auth_forms.diff (2.3 KB ) - added by Julien Phalip 16 years ago.
authentication_form.diff (8.8 KB ) - added by Chris Beaven 16 years ago.

Download all attachments as: .zip

Change History (19)

by Julien Phalip, 16 years ago

Attachment: 8274.auth_forms.diff added

comment:1 by Malcolm Tredinnick, 16 years ago

milestone: 1.01.0 maybe
Triage Stage: UnreviewedAccepted

comment:2 by Julien Phalip, 16 years ago

Just a note: the same request has been checked in for password reset views, see #6905.

comment:3 by Jacob, 16 years ago

milestone: 1.0 maybepost-1.0

comment:4 by Julien Phalip, 16 years ago

Owner: changed from nobody to Julien Phalip
Status: newassigned

#9168 was closed as dupe but contains a good addition to the docs for custom auth backends.

by Chris Beaven, 16 years ago

Attachment: authentication_form.diff added

comment:5 by Chris Beaven, 16 years ago

Triage Stage: AcceptedReady for checkin

Ok, here's a patch with both changes and docs.

It also makes the password_change_form use keyword arguments for niceness (and patch is a bit bigger because my editor strips trailing whitespace).

comment:6 by Dave Naffziger, 16 years ago

Cc: Dave Naffziger added

comment:7 by Bob Thomas, 16 years ago

Cc: bthomas@… added

comment:8 by Freark van der Bos, 16 years ago

Cc: Freark van der Bos added

comment:9 by (none), 16 years ago

milestone: post-1.0

Milestone post-1.0 deleted

comment:10 by steph, 16 years ago

Cc: steph added

comment:11 by anonymous, 16 years ago

Cc: graham@… added

comment:12 by Felipe 'chronos' Prenholato, 16 years ago

Cc: philipe.rp@… added

comment:13 by Michel Sabchuk, 15 years ago

Cc: michel@… added

comment:14 by jamstooks, 15 years ago

Cc: ben@… added

Any plans on adopting this? Does this need to be associated with a milestone again to get checked in?

comment:15 by MonteDavidoff, 15 years ago

Cc: MonteDavidoff added

comment:16 by Luke Plant, 15 years ago

Resolution: fixed
Status: assignedclosed

Implemented in r11618

comment:17 by Vasily Ivanov, 14 years ago

Cc: bas@… added
Note: See TracTickets for help on using tickets.
Back to Top