From 22667230bb9a3267dbd34837a35cf8473daec217 Mon Sep 17 00:00:00 2001 From: Girish Date: Thu, 14 Apr 2016 12:54:50 +0100 Subject: [PATCH] passing on the context/request to serializer --- rest_auth/views.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rest_auth/views.py b/rest_auth/views.py index 8420c32..55f767d 100644 --- a/rest_auth/views.py +++ b/rest_auth/views.py @@ -63,9 +63,9 @@ class LoginView(GenericAPIView): 'user': self.user, 'token': self.token } - serializer = serializer_class(instance=data) + serializer = serializer_class(instance=data, context={'request': self.request}) 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)