Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: API response for activating users returns 403 Forbidden #108

Merged
merged 3 commits into from
Apr 14, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions token_auth/views/register.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from django.utils.encoding import force_bytes, force_text
from django.utils.http import urlsafe_base64_decode, urlsafe_base64_encode
from rest_framework import status
from rest_framework.decorators import api_view
from rest_framework.decorators import api_view, permission_classes
from rest_framework.permissions import AllowAny
from rest_framework.response import Response
from rest_framework.views import APIView
Expand All @@ -14,10 +14,8 @@
User = get_user_model()


@permission_classes([AllowAny])
class RegisterView(APIView):

permission_classes = [AllowAny]

def post(self, request, *args, **kwargs):
"""
Function for creating user account
Expand All @@ -40,6 +38,7 @@ def post(self, request, *args, **kwargs):
return Response({"Please confirm your email to Login succesfully"}, status.HTTP_201_CREATED)

@api_view(("GET",))
@permission_classes([AllowAny])
def activate(request, uidb64, token):
"""
Function for account activation
Expand Down