Skip to content

Commit

Permalink
fix: redirect to login page after signup verification
Browse files Browse the repository at this point in the history
  • Loading branch information
Adibov committed Nov 26, 2023
1 parent a88c77c commit a534350
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion backend/backend_api/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ def has_add_permission(self, request):
return False

def has_delete_permission(self, request, obj=None):
return False
return request.user.is_staff

class Meta:
model = models.Payment
Expand Down
7 changes: 5 additions & 2 deletions backend/backend_api/views.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import datetime
import os
import urllib.parse

from django.core.exceptions import ObjectDoesNotExist
from django.shortcuts import get_object_or_404
from django.shortcuts import get_object_or_404, redirect
from rest_framework import status, mixins
from rest_framework import viewsets
from rest_framework.decorators import action
Expand All @@ -12,6 +14,7 @@
)
from rest_framework.response import Response

from aaiss_backend.settings import BASE_URL
from backend_api import models
from backend_api import serializers
from backend_api.models import User, Account, Payment, Staff, WorkshopRegistration, PresentationParticipation
Expand Down Expand Up @@ -205,7 +208,7 @@ def activate(self, request):
status.HTTP_400_BAD_REQUEST, "Token didn't match with any user"))
account.is_active = True
account.save()
return Response(new_detailed_response(status.HTTP_200_OK, "User activated successfully"))
return redirect(urllib.parse.urljoin(BASE_URL, 'signup'))


class PaymentViewSet(viewsets.GenericViewSet):
Expand Down

0 comments on commit a534350

Please sign in to comment.