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 Thijs Baaijen)

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

Change History (1)

comment:1 by Thijs Baaijen, 5 years ago

Description: modified (diff)
Note: See TracTickets for help on using tickets.
Back to Top