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 4
4
5
5
from django .contrib .auth import authenticate
6
6
from rest_framework import serializers
7
+ from .compat import Serializer
7
8
8
9
from rest_framework_jwt import utils
9
10
from rest_framework_jwt .settings import api_settings
15
16
jwt_get_user_id_from_payload = api_settings .JWT_PAYLOAD_GET_USER_ID_HANDLER
16
17
17
18
18
- class JSONWebTokenSerializer (serializers . Serializer ):
19
+ class JSONWebTokenSerializer (Serializer ):
19
20
"""
20
21
Serializer class used to validate a username and password.
21
22
@@ -71,7 +72,7 @@ def validate(self, attrs):
71
72
raise serializers .ValidationError (msg )
72
73
73
74
74
- class RefreshJSONWebTokenSerializer (serializers . Serializer ):
75
+ class RefreshJSONWebTokenSerializer (Serializer ):
75
76
"""
76
77
Check an access token
77
78
"""
You can’t perform that action at this time.
0 commit comments