Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 5241640

Browse files
committed
Fix import NoReverseMatch
1 parent f0158f6 commit 5241640

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

‎rest_framework_json_api/relations.py‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44

55
import inflection
66
import six
7+
import django
78
from django.core.exceptions import ImproperlyConfigured
8-
from django.core.urlresolvers import NoReverseMatch
99
from django.utils.translation import ugettext_lazy as _
1010
from rest_framework.fields import MISSING_ERROR_MESSAGE
1111
from rest_framework.relations import MANY_RELATION_KWARGS, PrimaryKeyRelatedField
@@ -21,6 +21,11 @@
2121
get_resource_type_from_serializer
2222
)
2323

24+
if django.VERSION >= (1, 10):
25+
from django.urls import NoReverseMatch
26+
else:
27+
from django.core.urlresolvers import NoReverseMatch
28+
2429
LINKS_PARAMS = [
2530
'self_link_view_name',
2631
'related_link_view_name',

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /