Opened 11 years ago
Closed 11 years ago
#20532 closed Cleanup/optimization (fixed)
Password reset email template should reverse view by name, not by path
Reported by: | Owned by: | Simon Charette | |
---|---|---|---|
Component: | contrib.admin | Version: | dev |
Severity: | Normal | Keywords: | |
Cc: | bmispelon@…, timograham@… | Triage Stage: | Accepted |
Has patch: | yes | Needs documentation: | yes |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
password_reset_email.html
reverses a url for django.contrib.auth.views.password_reset_confirm
. This fails when you have substituted your own password_reset_confirm
view, despite naming it correctly in your urlconf.
This is potentially backwards-incompatible if someone is using their own urlconf for the password reset views, but neglected to name them. However, these views are documented as being named: https://docs.djangoproject.com/en/1.5/topics/auth/default/#django.contrib.auth.views.password_reset_confirm
Change History (10)
comment:1 by , 11 years ago
comment:2 by , 11 years ago
Component: | Uncategorized → contrib.admin |
---|---|
Triage Stage: | Unreviewed → Accepted |
Type: | Uncategorized → Cleanup/optimization |
comment:3 by , 11 years ago
Cc: | added |
---|---|
Patch needs improvement: | set |
FYI, this is an issue that I came upon while working on #17209.
If I remember well, there are several places in django that still reverse auth views this way (which breaks when all you have is class-based views).
I'm marking this as patch needs improvement
because I think we should fix all these reverse issues at once.
I'll push the latest version of my branch for #17209 later today and maybe we can backport the fix from there.
Thanks.
comment:4 by , 11 years ago
Patch needs improvement: | unset |
---|
It would be nice to have this fixed in 1.6, so I think it can be fixed independently of #17209. I updated the patch to fix all occurences.
comment:6 by , 11 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
Version: | 1.5 → master |
I'll commit this.
comment:7 by , 11 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
comment:8 by , 11 years ago
Cc: | added |
---|---|
Needs documentation: | set |
Resolution: | fixed |
Severity: | Normal → Release blocker |
Status: | closed → new |
Triage Stage: | Ready for checkin → Accepted |
Our example for adding a password reset feature in the admin uses an unnamed pattern for a couple of these views. At a minimum this example needs to be updated. I think this change also deserves a mention in the release notes.
comment:10 by , 11 years ago
Resolution: | → fixed |
---|---|
Severity: | Release blocker → Normal |
Status: | new → closed |
Pull request: https://github.com/django/django/pull/1235