Opened 7 years ago

Closed 5 years ago

#12202 closed New feature (fixed)

Hardcoded subject in the reset password mail

Reported by: anonymous Owned by: Austin Gabel
Component: contrib.auth Version: master
Severity: Normal Keywords: reset password mail
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: yes
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

The subject of the mail which will be sent after a user wants to reset his password should be customizeable as well in the appropriate template. See django-registration (activation_email.txt, activation_email_subject.txt).

Attachments (3)

reset_password.diff (2.2 KB) - added by Austin Gabel 7 years ago.
Attached the wrong patch before. I will be bringing up this patch to django-dev shortly.
12202_with_test.diff (4.6 KB) - added by Claude Paroz 6 years ago.
Updated patch containing a test
12202.1.diff (5.8 KB) - added by Ramiro Morales 6 years ago.
Claude patch plus update of makmessages command and reset_password() view

Download all attachments as: .zip

Change History (17)

comment:1 Changed 7 years ago by Chris Beaven

Triage Stage: UnreviewedAccepted

This shouldn't be hardcoded (the actual solution, be it the proposed solution of separate template for the subject or alternatively just an argument in the view & form is up for debate).

comment:2 Changed 7 years ago by Austin Gabel

Component: Authenticationdjango.contrib.admin
milestone: 1.2
Needs documentation: set
Needs tests: set
Owner: changed from nobody to Austin Gabel
Status: newassigned

comment:3 Changed 7 years ago by Austin Gabel

Component: django.contrib.adminAuthentication

comment:4 Changed 7 years ago by Austin Gabel

I believe using a template for the subject is the correct way to go here. An argument would have to be something like 'subject=None' which seems confusing to me since there is a default subject line.

comment:5 Changed 7 years ago by Chris Beaven

I'd suggest bringing it up in the django-dev group. Not sure we have a precedent set for this.

Changed 7 years ago by Austin Gabel

Attachment: reset_password.diff added

Attached the wrong patch before. I will be bringing up this patch to django-dev shortly.

comment:6 Changed 7 years ago by Austin Gabel

Has patch: set
Triage Stage: AcceptedDesign decision needed

comment:7 Changed 7 years ago by jkocherhans

milestone: 1.2

1.2 is feature frozen. Removing from the 1.2 milestone.

comment:8 Changed 7 years ago by Austin Gabel

milestone: 1.3

comment:9 Changed 6 years ago by Eric Holscher

Triage Stage: Design decision neededAccepted
Version: 1.1SVN

This seems sane to me. I don't know if a template, or a passed in string is the correct answer, but I think the fact that it shouldn't be hard coded is pretty clear. Going to change this back to accepted for now.

For this to get into trunk though, it will require docs & tests though.

comment:10 Changed 6 years ago by Jannis Leidel

Yes, templates are the way to go here. Please use *.txt file extensions for them though, since the emails are clearly not HTML.

Changed 6 years ago by Claude Paroz

Attachment: 12202_with_test.diff added

Updated patch containing a test

comment:11 Changed 6 years ago by Claude Paroz

Needs tests: unset

Here are some progress on this ticket (updated patch with test).
About the .txt extension for the template, I fear that the standard makemessages will not parse it for extracting the translatable content.

For docs, it appears that the registration forms API is not detailed in the documentation (http://docs.djangoproject.com/en/1.2/topics/auth/#module-django.contrib.auth.forms). However, this raises the fact that the password_reset view might also receive a subject_template_name parameter. Is this wanted?

Changed 6 years ago by Ramiro Morales

Attachment: 12202.1.diff added

Claude patch plus update of makmessages command and reset_password() view

comment:12 Changed 6 years ago by Matt McClanahan

milestone: 1.3
Severity: Normal
Type: New feature

comment:13 Changed 5 years ago by Jannis Leidel

In [16437]:

Added '.txt' to list of file extensions that the makemessages management command automatically scans. Refs #12202.

comment:14 Changed 5 years ago by Jannis Leidel

Resolution: fixed
Status: assignedclosed

In [16438]:

Fixed #12202 -- Removed hardcoded password reset subject and added a subject_template_name parameter to the password_reset view. Thanks, Ramiro Morales, Claude Paroz and agabel.

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