Skip to content

Commit e3a2fd9

Browse files
committed
Fix import NoReverseMatch
1 parent f0158f6 commit e3a2fd9

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

rest_framework_json_api/relations.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
import inflection
66
import six
77
from django.core.exceptions import ImproperlyConfigured
8-
from django.core.urlresolvers import NoReverseMatch
98
from django.utils.translation import ugettext_lazy as _
109
from rest_framework.fields import MISSING_ERROR_MESSAGE
1110
from rest_framework.relations import MANY_RELATION_KWARGS, PrimaryKeyRelatedField
@@ -21,6 +20,11 @@
2120
get_resource_type_from_serializer
2221
)
2322

23+
if django.VERSION >= (1, 10):
24+
from django.urls import NoReverseMatch
25+
else:
26+
from django.core.urlresolvers import NoReverseMatch
27+
2428
LINKS_PARAMS = [
2529
'self_link_view_name',
2630
'related_link_view_name',

0 commit comments

Comments
 (0)