Merge pull request #289 from squallcs12/refactor/allow-VerifyEmailView-work-with-swagger

Make VerifyEmailView display data field in swagger
This commit is contained in:
Maxim Kukhtenkov 2016-12-21 11:05:28 -08:00 committed by GitHub
commit 592ea78edc

View File

@ -69,8 +69,11 @@ class VerifyEmailView(APIView, ConfirmEmailView):
permission_classes = (AllowAny,)
allowed_methods = ('POST', 'OPTIONS', 'HEAD')
def get_serializer(self, *args, **kwargs):
return VerifyEmailSerializer(*args, **kwargs)
def post(self, request, *args, **kwargs):
serializer = VerifyEmailSerializer(data=request.data)
serializer = self.get_serializer(data=request.data)
serializer.is_valid(raise_exception=True)
self.kwargs['key'] = serializer.validated_data['key']
confirmation = self.get_object()