Pass context to user defined USER_DETAILS_SERIALIZER

This commit is contained in:
Vladislav Manchev 2017-04-26 23:20:10 +02:00 committed by GitHub
parent 8c58782e30
commit 052094d43c

View File

@ -146,7 +146,7 @@ class JWTSerializer(serializers.Serializer):
JWTUserDetailsSerializer = import_callable( JWTUserDetailsSerializer = import_callable(
rest_auth_serializers.get('USER_DETAILS_SERIALIZER', UserDetailsSerializer) 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 return user_data