Opened 15 years ago

Closed 14 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: dev
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: no UI/UX: no

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 15 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 14 years ago.
Updated patch containing a test
12202.1.diff (5.8 KB ) - added by Ramiro Morales 14 years ago.
Claude patch plus update of makmessages command and reset_password() view

Download all attachments as: .zip

Change History (17)

comment:1 by Chris Beaven, 15 years ago

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 by Austin Gabel, 15 years ago

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

comment:3 by Austin Gabel, 15 years ago

Component: django.contrib.adminAuthentication

comment:4 by Austin Gabel, 15 years ago

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 by Chris Beaven, 15 years ago

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

by Austin Gabel, 15 years ago

Attachment: reset_password.diff added

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

comment:6 by Austin Gabel, 15 years ago

Has patch: set
Triage Stage: AcceptedDesign decision needed

comment:7 by jkocherhans, 15 years ago

milestone: 1.2

1.2 is feature frozen. Removing from the 1.2 milestone.

comment:8 by Austin Gabel, 15 years ago

milestone: 1.3

comment:9 by Eric Holscher, 14 years ago

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 by Jannis Leidel, 14 years ago

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

by Claude Paroz, 14 years ago

Attachment: 12202_with_test.diff added

Updated patch containing a test

comment:11 by Claude Paroz, 14 years ago

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?

by Ramiro Morales, 14 years ago

Attachment: 12202.1.diff added

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

comment:12 by Matt McClanahan, 14 years ago

milestone: 1.3
Severity: Normal
Type: New feature

comment:13 by Jannis Leidel, 14 years ago

In [16437]:

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

comment:14 by Jannis Leidel, 14 years ago

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