new user activation working
This commit is contained in:
@@ -202,10 +202,10 @@ def activate_user(request, uidb64, token):
|
||||
except (TypeError, ValueError, OverflowError, User.DoesNotExist):
|
||||
user = None
|
||||
|
||||
if user is not None and account_activation_token.check_token(user, token):
|
||||
if user is not None and utils.account_activation_token.check_token(user, token):
|
||||
# activate user
|
||||
user.is_active = True
|
||||
user.save()
|
||||
return HttpResponse(f"Tu cuenta de usuario {request.user.email} ha sido activada")
|
||||
return Response(f"Tu cuenta de usuario {user.email} ha sido activada")
|
||||
else:
|
||||
return HttpResponse(f"Tu token de verificacion no coincide con ningún usuario registrado")
|
||||
return Response({"error": f"Tu token de verificacion no coincide con ningún usuario registrado"}, status=status.HTTP_406_NOT_ACCEPTABLE)
|
||||
|
||||
Reference in New Issue
Block a user