mirror of
https://github.com/Tivix/django-rest-auth.git
synced 2024-11-22 17:16:34 +03:00
passing on the context/request to serializer
This commit is contained in:
parent
49ccfe92a9
commit
22667230bb
|
@ -63,9 +63,9 @@ class LoginView(GenericAPIView):
|
||||||
'user': self.user,
|
'user': self.user,
|
||||||
'token': self.token
|
'token': self.token
|
||||||
}
|
}
|
||||||
serializer = serializer_class(instance=data)
|
serializer = serializer_class(instance=data, context={'request': self.request})
|
||||||
else:
|
else:
|
||||||
serializer = serializer_class(instance=self.token)
|
serializer = serializer_class(instance=self.token, context={'request': self.request})
|
||||||
|
|
||||||
return Response(serializer.data, status=status.HTTP_200_OK)
|
return Response(serializer.data, status=status.HTTP_200_OK)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user