Pass request in the context when initializing LoginSerializer

This commit is contained in:
bIgBV 2017-06-24 18:50:50 +05:30
parent 606858fba7
commit 98306a35c1

View File

@ -88,7 +88,7 @@ class LoginView(GenericAPIView):
def post(self, request, *args, **kwargs):
self.request = request
self.serializer = self.get_serializer(data=self.request.data)
self.serializer = self.get_serializer(data=self.request.data, context={'request': request})
self.serializer.is_valid(raise_exception=True)
self.login()