Merge pull request #327 from blablacio/user-details-serializer-context

Pass context to user defined USER_DETAILS_SERIALIZER
This commit is contained in:
Maxim Kukhtenkov 2017-10-02 11:26:37 -04:00 committed by GitHub
commit 53398f8727

View File

@ -146,7 +146,7 @@ class JWTSerializer(serializers.Serializer):
JWTUserDetailsSerializer = import_callable(
rest_auth_serializers.get('USER_DETAILS_SERIALIZER', UserDetailsSerializer)
)
user_data = JWTUserDetailsSerializer(obj['user']).data
user_data = JWTUserDetailsSerializer(obj['user'], context=self.context).data
return user_data