mirror of
https://github.com/Tivix/django-rest-auth.git
synced 2024-12-02 13:53:43 +03:00
Make verify email browsable
This commit is contained in:
parent
c5d553dfb1
commit
6cdcbfacd2
|
@ -19,7 +19,7 @@ from django.utils.decorators import method_decorator
|
||||||
from django.utils.translation import ugettext_lazy as _
|
from django.utils.translation import ugettext_lazy as _
|
||||||
from django.views.decorators.debug import sensitive_post_parameters
|
from django.views.decorators.debug import sensitive_post_parameters
|
||||||
from rest_framework import status
|
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.generics import CreateAPIView, GenericAPIView, ListAPIView
|
||||||
from rest_framework.permissions import AllowAny, IsAuthenticated
|
from rest_framework.permissions import AllowAny, IsAuthenticated
|
||||||
from rest_framework.response import Response
|
from rest_framework.response import Response
|
||||||
|
@ -86,6 +86,9 @@ class VerifyEmailView(APIView, ConfirmEmailView):
|
||||||
def get_serializer(self, *args, **kwargs):
|
def get_serializer(self, *args, **kwargs):
|
||||||
return VerifyEmailSerializer(*args, **kwargs)
|
return VerifyEmailSerializer(*args, **kwargs)
|
||||||
|
|
||||||
|
def get(self, *args, **kwargs):
|
||||||
|
raise MethodNotAllowed('GET')
|
||||||
|
|
||||||
def post(self, request, *args, **kwargs):
|
def post(self, request, *args, **kwargs):
|
||||||
serializer = self.get_serializer(data=request.data)
|
serializer = self.get_serializer(data=request.data)
|
||||||
serializer.is_valid(raise_exception=True)
|
serializer.is_valid(raise_exception=True)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user