Opened 6 years ago

Closed 4 years ago

#12202 closed New feature (fixed)

Hardcoded subject in the reset password mail

Reported by: anonymous Owned by: agabel
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 agabel 6 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 claudep 4 years ago.
Updated patch containing a test
12202.1.diff (5.8 KB) - added by ramiro 4 years ago.
Claude patch plus update of makmessages command and reset_password() view

Download all attachments as: .zip

Change History (17)

comment:1 Changed 6 years ago by SmileyChris

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

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 6 years ago by agabel

  • Component changed from Authentication to django.contrib.admin
  • milestone set to 1.2
  • Needs documentation set
  • Needs tests set
  • Owner changed from nobody to agabel
  • Status changed from new to assigned

comment:3 Changed 6 years ago by agabel

  • Component changed from django.contrib.admin to Authentication

comment:4 Changed 6 years ago by agabel

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 6 years ago by SmileyChris

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

Changed 6 years ago by agabel

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

comment:6 Changed 5 years ago by agabel

  • Has patch set
  • Triage Stage changed from Accepted to Design decision needed

comment:7 Changed 5 years ago by jkocherhans

  • milestone 1.2 deleted

1.2 is feature frozen. Removing from the 1.2 milestone.

comment:8 Changed 5 years ago by agabel

  • milestone set to 1.3

comment:9 Changed 5 years ago by ericholscher

  • Triage Stage changed from Design decision needed to Accepted
  • Version changed from 1.1 to SVN

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 5 years ago by jezdez

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

Changed 4 years ago by claudep

Updated patch containing a test

comment:11 Changed 4 years ago by claudep

  • 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 4 years ago by ramiro

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

comment:12 Changed 4 years ago by mattmcc

  • milestone 1.3 deleted
  • Severity set to Normal
  • Type set to New feature

comment:13 Changed 4 years ago by jezdez

In [16437]:

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

comment:14 Changed 4 years ago by jezdez

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

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