Django

Code

Ticket #2375 (closed: fixed)

Opened 2 years ago

Last modified 2 years ago

[patch] Let email template be variable for password reset

Reported by: treborhudson@gmail.com Assigned to: adrian
Milestone: Component: Contrib apps
Version: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: 1 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

Description

Similar to the other fairly recent changes where you can pass in a different template name for login, logout, password_change[_done], password_reset[_done] in urls.py, the email template should also have the ability to be overridden. For example, in my case, I'm putting all login related stuff in the accounts template directory. Without this functionality you always need a registration template directory.

I've got a proposed diff that is tested and is working on a site I'm developing. I'll submit it after posting this. I'm not sure of the correct way to submit a patch so I'm using "svn diff > email_template.patch".

What this will do is allow one to override the email template you set it in your urls.py like so:

(r'accounts/password_reset/$', 'django.contrib.auth.views.password_reset', {'template_name': 'accounts/pwreset.html', 'email_template_name': 'accounts/pwreset_email.txt'}),

Note the new key "email_template_name" is new.

Attachments

email_template.patch (2.2 kB) - added by treborhudson@gmail.com on 07/19/06 01:15:08.
email_template.2.patch (2.3 kB) - added by treborhudson@gmail.com on 07/19/06 01:20:20.
The first patch forgot the default email template in save() function

Change History

07/19/06 01:15:08 changed by treborhudson@gmail.com

  • attachment email_template.patch added.

07/19/06 01:20:20 changed by treborhudson@gmail.com

  • attachment email_template.2.patch added.

The first patch forgot the default email template in save() function

07/24/06 14:09:32 changed by anonymous

  • summary changed from Let email template be variable for password reset to [patch] Let email template be variable for password reset.

07/27/06 12:48:35 changed by adrian

  • status changed from new to closed.
  • resolution set to fixed.

(In [3462]) Fixed #2375 -- Changed password_reset auth view to make e-mail template name variable. Thanks, treborhudson@gmail.com


Add/Change #2375 ([patch] Let email template be variable for password reset)




Change Properties
Action