Use the url_field_name from get_identity() as well.

This commit is contained in:
Don Spaulding 2013-06-21 12:53:34 -05:00
parent e9b112eecb
commit d64be3f079

View File

@ -950,7 +950,7 @@ class HyperlinkedModelSerializer(ModelSerializer):
We need to override the default, to use the url as the identity.
"""
try:
return data.get('url', None)
return data.get(self.opts.url_field_name, None)
except AttributeError:
return None