Opened 12 months ago

Last modified 2 months ago

#20705 new New feature

Allow customizing the email field name for PasswordResetForm

Reported by: Cloudream Owned by: nobody
Component: contrib.auth Version: master
Severity: Normal Keywords:
Cc: Cloudream, jorgecarleitao Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


Like USERNAME_FIELD, add a similar parameter so PasswordResetForm, and other customized user model functions, do not rely on fixed name email field to send emails.

Attachments (0)

Change History (5)

comment:1 Changed 12 months ago by Cloudream

  • Cc Cloudream added
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

comment:2 Changed 12 months ago by timo

  • Summary changed from Set email field for PasswordResetForm to Allow customizing the email field name for PasswordResetForm
  • Triage Stage changed from Unreviewed to Accepted

Seems like a reasonable request.

comment:3 Changed 11 months ago by susan

I've been reading this doc for context + background:

It seems that I'll need to edit the PasswordResetForm class method located in contrib.auth.forms. In particular, L27 might needed to be changed: "email = forms.EmailField(label=_("Email"), max_length=254)"

Is there an existing similar example that I can follow? I've done a global search on USERNAME_FIELD, which returned a lot of results; I'm not sure which are the relevant files to look at.

comment:4 Changed 11 months ago by timo

This isn't about renaming the form field, but rather not assuming the "email" field on the UserModel is called "email". We could accomplish this on PasswordResetForm by passing in a parameter to the save method with the name of the field, but it would be better to get an idea of the "other customized user model functions" the OP had in mind to better determine the feasibility and design of this.

comment:5 Changed 2 months ago by jorgecarleitao

  • Cc jorgecarleitao added

Doesn't the ticket #17431 solves this?

Add Comment

Modify Ticket

Change Properties
<Author field>
as new
The owner will be changed from nobody to anonymous. Next status will be 'assigned'
as The resolution will be set. Next status will be 'closed'

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.