mirror of
https://github.com/Tivix/django-rest-auth.git
synced 2025-07-07 20:53:04 +03:00
Add context to response_serializer in LoginView
When context is missing, FileField cannot return absolute urls, that made inconsistency when used absolute urls everywhere else. serializer_class got it injected by inherited APIView, while custom serializer that is defined here didn't. This commit fixes it.
This commit is contained in:
parent
00415301d6
commit
c5d79f6f27
|
@ -41,7 +41,7 @@ class LoginView(GenericAPIView):
|
||||||
|
|
||||||
def get_response(self):
|
def get_response(self):
|
||||||
return Response(
|
return Response(
|
||||||
self.response_serializer(self.token).data, status=status.HTTP_200_OK
|
self.response_serializer(self.token, context=self.get_serializer_context()).data, status=status.HTTP_200_OK
|
||||||
)
|
)
|
||||||
|
|
||||||
def post(self, request, *args, **kwargs):
|
def post(self, request, *args, **kwargs):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user