Opened 7 years ago

Closed 6 years ago

Last modified 5 years ago

#8274 closed (fixed)

Auth views should allow form customization

Reported by: julien Owned by: julien
Component: contrib.auth Version: master
Severity: Keywords:
Cc: philipe.rp@…, davenaff, bthomas@…, frearkvanderbos, steph, graham@…, michel@…, ben@…, mnd, bas@… Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

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 7 years ago.
authentication_form.diff (8.8 KB) - added by SmileyChris 7 years ago.

Download all attachments as: .zip

Change History (19)

Changed 7 years ago by julien

comment:1 Changed 7 years ago by mtredinnick

  • milestone changed from 1.0 to 1.0 maybe
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Accepted

comment:2 Changed 7 years ago by julien

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

comment:3 Changed 7 years ago by jacob

  • milestone changed from 1.0 maybe to post-1.0

comment:4 Changed 7 years ago by julien

  • Owner changed from nobody to julien
  • Status changed from new to assigned

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

Changed 7 years ago by SmileyChris

comment:5 Changed 7 years ago by SmileyChris

  • Triage Stage changed from Accepted to Ready 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 Changed 7 years ago by davenaff

  • Cc davenaff added

comment:7 Changed 7 years ago by bthomas

  • Cc bthomas@… added

comment:8 Changed 7 years ago by frearkvanderbos

  • Cc frearkvanderbos added

comment:9 Changed 7 years ago by anonymous

  • milestone post-1.0 deleted

Milestone post-1.0 deleted

comment:10 Changed 6 years ago by steph

  • Cc steph added

comment:11 Changed 6 years ago by anonymous

  • Cc graham@… added

comment:12 Changed 6 years ago by chronos

  • Cc philipe.rp@… added

comment:13 Changed 6 years ago by michelts

  • Cc michel@… added

comment:14 Changed 6 years ago by jamstooks

  • Cc ben@… added

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

comment:15 Changed 6 years ago by mnd

  • Cc mnd added

comment:16 Changed 6 years ago by lukeplant

  • Resolution set to fixed
  • Status changed from assigned to closed

Implemented in r11618

comment:17 Changed 5 years ago by parxier

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