Skip to content
This repository was archived by the owner on May 26, 2020. It is now read-only.

Commit ac14d94

Browse files
committed
Simplify and cleanup import
This commit pushes the import to the proper place and assumes that the import will *not* break DRF compatibility prior to version 3.0.0. Assuming the travis tests cover all prior supported versions and import compat.py, the tests would catch this.
1 parent 2937924 commit ac14d94

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

rest_framework_jwt/compat.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import rest_framework
2+
import rest_framework.serializers
23
from django.forms import widgets
34
from distutils.version import StrictVersion
45

@@ -9,9 +10,6 @@
910
class PasswordField(CharField):
1011
widget = widgets.PasswordInput
1112
else:
12-
# Mid-file import to potentially prevent issues occuring for DRF pre 3.0.0
13-
import rest_framework.serializers
14-
1513
class Serializer(rest_framework.serializers.Serializer):
1614
@property
1715
def object(self):

0 commit comments

Comments
 (0)