From 24675e77b107385650b1ce8bc70bcea4fbc2acab Mon Sep 17 00:00:00 2001 From: Bruno Michetti Date: Wed, 9 Oct 2019 19:30:43 -0300 Subject: [PATCH] Add get function to make verify email browsable --- rest_auth/registration/views.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/rest_auth/registration/views.py b/rest_auth/registration/views.py index 0e0ab0d..0a12197 100644 --- a/rest_auth/registration/views.py +++ b/rest_auth/registration/views.py @@ -8,7 +8,7 @@ from rest_framework.response import Response from rest_framework.permissions import (AllowAny, IsAuthenticated) from rest_framework.generics import CreateAPIView, ListAPIView, GenericAPIView -from rest_framework.exceptions import NotFound +from rest_framework.exceptions import NotFound, MethodNotAllowed from rest_framework import status from allauth.account.adapter import get_adapter @@ -86,6 +86,9 @@ class VerifyEmailView(APIView, ConfirmEmailView): permission_classes = (AllowAny,) allowed_methods = ('POST', 'OPTIONS', 'HEAD') + def get(self, *args, **kwargs): + raise MethodNotAllowed('GET') + def get_serializer(self, *args, **kwargs): return VerifyEmailSerializer(*args, **kwargs)