changeset 752:95f4e7f352fd

For Django 1.6: contrib auth password reset confirm view signature changed. The uidb64 parameter was previously base 36 encoded and named uidb36. Had to update urls.py. While I was in there I decided to make the password reset email use the {% url %} tag to be more resilient if the url changes.
author Brian Neal <bgneal@gmail.com>
date Wed, 01 Jan 2014 19:52:07 -0600
parents 22fb12361fb3
children ad53d929281a
files accounts/urls.py sg101/templates/accounts/password_reset_email.txt
diffstat 2 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/accounts/urls.py	Tue Dec 31 17:21:11 2013 -0600
+++ b/accounts/urls.py	Wed Jan 01 19:52:07 2014 -0600
@@ -32,7 +32,7 @@
         'django.contrib.auth.views.password_reset_done',
         kwargs={'template_name': 'accounts/password_reset_sent.html'},
         name='accounts-password_reset_sent'),
-    url(r'^password/reset/confirm/(?P<uidb36>[0-9a-z]+)/(?P<token>[0-9a-z]+-\w+)/$',
+    url(r'^password/reset/confirm/(?P<uidb64>[0-9A-Za-z_\-]+)/(?P<token>[0-9a-z]+-\w+)/$',
         'django.contrib.auth.views.password_reset_confirm',
         kwargs={
             'template_name': 'accounts/password_reset_confirm.html',
--- a/sg101/templates/accounts/password_reset_email.txt	Tue Dec 31 17:21:11 2013 -0600
+++ b/sg101/templates/accounts/password_reset_email.txt	Wed Jan 01 19:52:07 2014 -0600
@@ -4,7 +4,7 @@
 
 If you did request a password reset, please visit the following link, where you will be able to enter your new password:
 
-{{ protocol }}://{{ domain }}/accounts/password/reset/confirm/{{ uid }}/{{ token }}/
+{{ protocol }}://{{ domain }}{% url 'accounts-password_reset_confirm' uidb64=uid token=token %}
 
 Regards,