From 2602d66fefa5e8e96da25a7bd37e1c7fdba2cd87 Mon Sep 17 00:00:00 2001 From: Ranet P Date: Tue, 21 Apr 2020 18:17:57 +0300 Subject: [PATCH] Pass context to JWTSerializer and TokenSerializer --- dj_rest_auth/registration/views.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dj_rest_auth/registration/views.py b/dj_rest_auth/registration/views.py index e9577a1..937f327 100644 --- a/dj_rest_auth/registration/views.py +++ b/dj_rest_auth/registration/views.py @@ -52,9 +52,9 @@ class RegisterView(CreateAPIView): 'access_token': self.access_token, 'refresh_token': self.refresh_token } - return JWTSerializer(data).data + return JWTSerializer(data, context=self.get_serializer_context()).data else: - return TokenSerializer(user.auth_token).data + return TokenSerializer(user.auth_token, context=self.get_serializer_context()).data def create(self, request, *args, **kwargs): serializer = self.get_serializer(data=request.data)