Open jslovern391 opened 1 year ago
I added a log to this function and it returns nothing.
def activate(request, uidb64, token): try: uid = force_str(urlsafe_base64_decode(uidb64)) user = CustomUser.objects.get(pk=uid) file = open('D:\OneDrive\Rock Tech\path.txt', 'a') file.write(uidb64) file.write(token) file.close() 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!')
The first part of the token is the same and the second part is not coming through.
So the uid is giving a property not a value
<property object at 0x000001D3123D9DA0>
First I want to say thanks so much for this documentation. I have been looking for something like this for a CustomUser.
First thing the email shows the HTML.
Hello ,
Please click the link below to activate your account:
Activate your account">
If you did not register on our site, please ignore this message.
Best regards, Your Website Team
Second thing is that the link is invalid and trying to figure out where the issue is.
Thanks much.