mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-01-24 08:14:16 +03:00
Try to be marginally less awful if we can't reverse resolve the URL for a model. TODO: Give up on even trying to do such black magic in the first place?
This commit is contained in:
parent
14586916e2
commit
d3024ff181
|
@ -6,7 +6,7 @@ from django.db.models.fields.related import RelatedField
|
|||
from django.utils.encoding import smart_unicode
|
||||
|
||||
from djangorestframework.response import ErrorResponse
|
||||
from djangorestframework.serializer import Serializer
|
||||
from djangorestframework.serializer import Serializer, _SkipField
|
||||
from djangorestframework.utils import as_tuple
|
||||
|
||||
import decimal
|
||||
|
@ -342,7 +342,7 @@ class ModelResource(FormResource):
|
|||
"""
|
||||
|
||||
if not hasattr(self, 'view_callable'):
|
||||
raise NoReverseMatch
|
||||
raise _SkipField
|
||||
|
||||
# dis does teh magicks...
|
||||
urlconf = get_urlconf()
|
||||
|
@ -371,7 +371,7 @@ class ModelResource(FormResource):
|
|||
return reverse(self.view_callable[0], kwargs=instance_attrs)
|
||||
except NoReverseMatch:
|
||||
pass
|
||||
raise NoReverseMatch
|
||||
raise _SkipField
|
||||
|
||||
|
||||
@property
|
||||
|
|
Loading…
Reference in New Issue
Block a user