mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-23 01:57:00 +03:00
Fix view_name argument to HyperlinkedIdentityField
This commit is contained in:
parent
484ee8cc27
commit
102e906840
|
@ -379,10 +379,8 @@ class HyperlinkedIdentityField(Field):
|
|||
A field that represents the model's identity using a hyperlink.
|
||||
"""
|
||||
def __init__(self, *args, **kwargs):
|
||||
try:
|
||||
self.view_name = kwargs.pop('view_name')
|
||||
except:
|
||||
raise ValueError("Hyperlinked field requires 'view_name' kwarg")
|
||||
# TODO: Make this mandatory
|
||||
self.view_name = kwargs.pop('view_name', None)
|
||||
super(HyperlinkedRelatedField, self).__init__(*args, **kwargs)
|
||||
|
||||
def field_to_native(self, obj, field_name):
|
||||
|
|
Loading…
Reference in New Issue
Block a user