mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-02 19:40:13 +03:00
Use the url_field_name from get_identity() as well.
This commit is contained in:
parent
e9b112eecb
commit
d64be3f079
|
@ -950,7 +950,7 @@ class HyperlinkedModelSerializer(ModelSerializer):
|
||||||
We need to override the default, to use the url as the identity.
|
We need to override the default, to use the url as the identity.
|
||||||
"""
|
"""
|
||||||
try:
|
try:
|
||||||
return data.get('url', None)
|
return data.get(self.opts.url_field_name, None)
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user