Skip to content

Commit cc0b0ee

Browse files
committed
defer import for Django 1.11
1 parent 9a94226 commit cc0b0ee

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

data_wizard/idmap.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
from rest_framework.serializers import ValidationError
2-
3-
41
def never(value, field):
52
return None
63

74

85
def existing(value, field):
6+
# FIXME: Move import to top when dropping Django 1.11
7+
from rest_framework.serializers import ValidationError
98
try:
109
field.to_internal_value(value)
1110
except ValidationError:

tests/data_app/wizard.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ class Meta:
4848
model = FKModel
4949
fields = "__all__"
5050

51+
5152
class SlugMapExistingSerializer(SlugSerializer):
5253
class Meta(SlugSerializer.Meta):
5354
data_wizard = {

0 commit comments

Comments
 (0)