Opened 5 years ago
Last modified 5 years ago
#30837 closed Cleanup/optimization
Changing password reset email template name to .txt extension — at Version 1
Reported by: | Thijs Baaijen | Owned by: | nobody |
---|---|---|---|
Component: | contrib.auth | Version: | dev |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | yes | UI/UX: | no |
Description (last modified by )
Hi there,
A minor issue that's been bothering me.
I'd like to make a case to change the default value of email_template_name of the PasswordResetView from
'registration/password_reset_email.html'
to
'registration/password_reset_email.txt'
Reason:
The extension ".html" seems to indicate that an html email is being sent, while it is actually a text email. I think this is confusing, especially to new developers. It makes you think at first that the email being sent wil be rendered to html, until you realize that you need to specify html_email_template_name for that.
Solutions:
If you'll agree, I've created a pull request for this tiny code change.
https://github.com/django/django/pull/11869
I can also see that changing this value now will cause a TemplateDoesNotExist error on existing installations.
Therefore I've created another pull request that fallsback to the .html variant if the template results in a TemplateDoesNotExist error.
https://github.com/django/django/pull/11870
Please let me know what you think of my proposed solutions.
Cheers,
Thijs