Skip to content

Commit

Permalink
django-2.0: Pass string to reverse.
Browse files Browse the repository at this point in the history
urlsafe_base64_encode returns bytes. These can safely be converted to
ascii encoding. If we pass bytes to reverse, the match fails.
  • Loading branch information
umairwaheed authored and timabbott committed Jan 31, 2018
1 parent 0c4066b commit b19d6e9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion zerver/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ def save(self,

if user is not None:
token = token_generator.make_token(user)
uid = urlsafe_base64_encode(force_bytes(user.id))
uid = urlsafe_base64_encode(force_bytes(user.id)).decode('ascii')
endpoint = reverse('django.contrib.auth.views.password_reset_confirm',
kwargs=dict(uidb64=uid, token=token))

Expand Down

0 comments on commit b19d6e9

Please sign in to comment.