user activation now redirects to home
This commit is contained in:
@@ -11,6 +11,8 @@ from django.utils.http import urlsafe_base64_decode
|
||||
from django.utils.encoding import force_text
|
||||
from django.db import IntegrityError
|
||||
from django.contrib.gis.geos import Point
|
||||
from django.shortcuts import redirect
|
||||
from django.conf import settings
|
||||
|
||||
from rest_framework import status
|
||||
from rest_framework import viewsets
|
||||
@@ -190,6 +192,8 @@ def activate_user(request, uidb64, token):
|
||||
# activate user
|
||||
user.is_active = True
|
||||
user.save()
|
||||
if settings.ACTIVATION_REDIRECT:
|
||||
return redirect(settings.ACTIVATION_REDIRECT)
|
||||
return Response(f"Tu cuenta de usuario {user.email} ha sido activada")
|
||||
else:
|
||||
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