From 6cdcbfacd22d219234e2f8abaf42ea922786b434 Mon Sep 17 00:00:00 2001 From: Bruno Michetti Date: Mon, 1 Jun 2020 17:53:33 -0300 Subject: [PATCH] Make verify email browsable --- dj_rest_auth/registration/views.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dj_rest_auth/registration/views.py b/dj_rest_auth/registration/views.py index 937f327..dd5bc4c 100644 --- a/dj_rest_auth/registration/views.py +++ b/dj_rest_auth/registration/views.py @@ -19,7 +19,7 @@ from django.utils.decorators import method_decorator from django.utils.translation import ugettext_lazy as _ from django.views.decorators.debug import sensitive_post_parameters from rest_framework import status -from rest_framework.exceptions import NotFound +from rest_framework.exceptions import NotFound, MethodNotAllowed from rest_framework.generics import CreateAPIView, GenericAPIView, ListAPIView from rest_framework.permissions import AllowAny, IsAuthenticated from rest_framework.response import Response @@ -86,6 +86,9 @@ class VerifyEmailView(APIView, ConfirmEmailView): def get_serializer(self, *args, **kwargs): return VerifyEmailSerializer(*args, **kwargs) + def get(self, *args, **kwargs): + raise MethodNotAllowed('GET') + def post(self, request, *args, **kwargs): serializer = self.get_serializer(data=request.data) serializer.is_valid(raise_exception=True)