﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
34891	force_str(urlsafe_base64_decode(uidb64)) returns object not value	Jeff Lovern	nobody	"Trying to decode:

PHByb3BlcnR5IG9iamVjdCBhdCAweDAwMDAwMjU1M0ZBNTlEQTA- 
bvlp6u-9b15d1fd6d30b90e81623812e9bc8d74 

force_str(urlsafe_base64_decode(uidb64)) returns:

Field 'id' expected a number but got b'<property object at 0x000002553FA59DA0>'.

The above exception (invalid literal for int() with base 10: b'<property object at 0x000002553FA59DA0>') was the direct cause of the following exception: 

Code:

def activate(request, uidb64, token):
    try:
        uid = force_str(urlsafe_base64_decode(uidb64))
        user = CustomUser.objects.get(pk=uid)

    except (TypeError, ValueError, OverflowError, CustomUser.DoesNotExist):
        user = None

    if user is not None and account_activation_token.check_token(user, token):
        user.is_active = True
        user.save()
        login(request, user)
        return redirect('account_activation_complete')
    else:
        return HttpResponseBadRequest('Activation link is invalid!')"	Bug	new	Utilities	4.2	Normal		django.utils.encoding		Unreviewed	0	0	0	0	0	0
