Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Merge pull request #1316 from ramiro/int_pk_pwd_reset

  • Loading branch information...
commit 5e3a6532aab7bf51aa5857c3de9479a7be0c2ae4 2 parents 3fd0ee5 + d51b779
Ramiro Morales authored June 29, 2013
22  django/contrib/auth/tests/test_views.py
@@ -13,7 +13,7 @@
13 13
 from django.core.urlresolvers import reverse, NoReverseMatch
14 14
 from django.http import QueryDict, HttpRequest
15 15
 from django.utils.encoding import force_text
16  
-from django.utils.http import int_to_base36, urlsafe_base64_decode, urlquote
  16
+from django.utils.http import urlquote
17 17
 from django.utils._os import upath
18 18
 from django.test import TestCase
19 19
 from django.test.utils import override_settings, patch_logger
@@ -193,16 +193,6 @@ def test_confirm_valid(self):
193 193
         # redirect to a 'complete' page:
194 194
         self.assertContains(response, "Please enter your new password")
195 195
 
196  
-    def test_confirm_valid_base36(self):
197  
-        # Remove in Django 1.7
198  
-        url, path = self._test_confirm_start()
199  
-        path_parts = path.strip("/").split("/")
200  
-        # construct an old style (base36) URL by converting the base64 ID
201  
-        path_parts[1] = int_to_base36(int(urlsafe_base64_decode(path_parts[1])))
202  
-        response = self.client.get("/%s/%s-%s/" % tuple(path_parts))
203  
-        # redirect to a 'complete' page:
204  
-        self.assertContains(response, "Please enter your new password")
205  
-
206 196
     def test_confirm_invalid(self):
207 197
         url, path = self._test_confirm_start()
208 198
         # Let's munge the token in the path, but keep the same length,
@@ -217,21 +207,11 @@ def test_confirm_invalid_user(self):
217 207
         response = self.client.get('/reset/123456/1-1/')
218 208
         self.assertContains(response, "The password reset link was invalid")
219 209
 
220  
-    def test_confirm_invalid_user_base36(self):
221  
-        # Remove in Django 1.7
222  
-        response = self.client.get('/reset/123456-1-1/')
223  
-        self.assertContains(response, "The password reset link was invalid")
224  
-
225 210
     def test_confirm_overflow_user(self):
226 211
         # Ensure that we get a 200 response for a base36 user id that overflows int
227 212
         response = self.client.get('/reset/zzzzzzzzzzzzz/1-1/')
228 213
         self.assertContains(response, "The password reset link was invalid")
229 214
 
230  
-    def test_confirm_overflow_user_base36(self):
231  
-        # Remove in Django 1.7
232  
-        response = self.client.get('/reset/zzzzzzzzzzzzz-1-1/')
233  
-        self.assertContains(response, "The password reset link was invalid")
234  
-
235 215
     def test_confirm_invalid_post(self):
236 216
         # Same as test_confirm_invalid, but trying
237 217
         # to do a POST instead.
3  django/contrib/auth/urls.py
@@ -12,9 +12,6 @@
12 12
     url(r'^password_change/done/$', 'django.contrib.auth.views.password_change_done', name='password_change_done'),
13 13
     url(r'^password_reset/$', 'django.contrib.auth.views.password_reset', name='password_reset'),
14 14
     url(r'^password_reset/done/$', 'django.contrib.auth.views.password_reset_done', name='password_reset_done'),
15  
-    # Support old style base36 password reset links; remove in Django 1.7
16  
-    url(r'^reset/(?P<uidb36>[0-9A-Za-z]{1,13})-(?P<token>[0-9A-Za-z]{1,13}-[0-9A-Za-z]{1,20})/$',
17  
-        'django.contrib.auth.views.password_reset_confirm_uidb36'),
18 15
     url(r'^reset/(?P<uidb64>[0-9A-Za-z_\-]+)/(?P<token>[0-9A-Za-z]{1,13}-[0-9A-Za-z]{1,20})/$',
19 16
         'django.contrib.auth.views.password_reset_confirm',
20 17
         name='password_reset_confirm'),
9  django/contrib/auth/views.py
@@ -228,15 +228,6 @@ def password_reset_confirm(request, uidb64=None, token=None,
228 228
     return TemplateResponse(request, template_name, context,
229 229
                             current_app=current_app)
230 230
 
231  
-def password_reset_confirm_uidb36(request, uidb36=None, **kwargs):
232  
-    # Support old password reset URLs that used base36 encoded user IDs.
233  
-    # Remove in Django 1.7
234  
-    try:
235  
-      uidb64 = force_text(urlsafe_base64_encode(force_bytes(base36_to_int(uidb36))))
236  
-    except ValueError:
237  
-      uidb64 = '1' # dummy invalid ID (incorrect padding for base64)
238  
-    return password_reset_confirm(request, uidb64=uidb64, **kwargs)
239  
-
240 231
 def password_reset_complete(request,
241 232
                             template_name='registration/password_reset_complete.html',
242 233
                             current_app=None, extra_context=None):

0 notes on commit 5e3a653

Please sign in to comment.
Something went wrong with that request. Please try again.