diff options
| author | Tim Graham <timograham@gmail.com> | 2015-02-13 09:12:30 -0500 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2015-02-13 09:56:31 -0500 |
| commit | 002425fe39f62faafaa32e400f7531809181a1a0 (patch) | |
| tree | 3216048d7d94e69635a5a9864bcb2918adb0bbaa /django | |
| parent | fdf20093e0f8cd064673aa1597c20727ed4dd2a0 (diff) | |
Fixed #24315 -- Fixed auth.views.password_reset_confirm() with a UUID user.
Diffstat (limited to 'django')
| -rw-r--r-- | django/contrib/auth/views.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/django/contrib/auth/views.py b/django/contrib/auth/views.py index de76157bdc..99363c392e 100644 --- a/django/contrib/auth/views.py +++ b/django/contrib/auth/views.py @@ -17,6 +17,7 @@ from django.http import HttpResponseRedirect, QueryDict from django.shortcuts import resolve_url from django.template.response import TemplateResponse from django.utils.deprecation import RemovedInDjango20Warning +from django.utils.encoding import force_text from django.utils.http import is_safe_url, urlsafe_base64_decode from django.utils.six.moves.urllib.parse import urlparse, urlunparse from django.utils.translation import ugettext as _ @@ -230,7 +231,8 @@ def password_reset_confirm(request, uidb64=None, token=None, else: post_reset_redirect = resolve_url(post_reset_redirect) try: - uid = urlsafe_base64_decode(uidb64) + # urlsafe_base64_decode() decodes to bytestring on Python 3 + uid = force_text(urlsafe_base64_decode(uidb64)) user = UserModel._default_manager.get(pk=uid) except (TypeError, ValueError, OverflowError, UserModel.DoesNotExist): user = None |
