This repository was archived by the owner on May 26, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change 1+ import rest_framework
2+ from distutils .version import StrictVersion
3+
4+ if StrictVersion (rest_framework .VERSION ) < StrictVersion ('3.0.0' ):
5+ from rest_framework .serializers import Serializer
6+ else :
7+ class Serializer (rest_framework .serializers .Serializer ):
8+ @property
9+ def object (self ):
10+ return self .validated_data
Original file line number Diff line number Diff line change 44
55from django .contrib .auth import authenticate
66from rest_framework import serializers
7+ from .compat import Serializer
78
89from rest_framework_jwt import utils
910from rest_framework_jwt .settings import api_settings
1516jwt_get_user_id_from_payload = api_settings .JWT_PAYLOAD_GET_USER_ID_HANDLER
1617
1718
18- class JSONWebTokenSerializer (serializers . Serializer ):
19+ class JSONWebTokenSerializer (Serializer ):
1920 """
2021 Serializer class used to validate a username and password.
2122
@@ -71,7 +72,7 @@ def validate(self, attrs):
7172 raise serializers .ValidationError (msg )
7273
7374
74- class RefreshJSONWebTokenSerializer (serializers . Serializer ):
75+ class RefreshJSONWebTokenSerializer (Serializer ):
7576 """
7677 Check an access token
7778 """
You can’t perform that action at this time.
0 commit comments