Use six.text_type for hyperlink names

This commit is contained in:
Tom Christie 2015-06-03 11:53:27 +01:00
parent 99e97fa9d3
commit b1b47036d7

View File

@ -218,7 +218,7 @@ class HyperlinkedRelatedField(RelatedField):
return self.reverse(view_name, kwargs=kwargs, request=request, format=format) return self.reverse(view_name, kwargs=kwargs, request=request, format=format)
def get_name(self, obj): def get_name(self, obj):
return str(obj) return six.text_type(obj)
def to_internal_value(self, data): def to_internal_value(self, data):
request = self.context.get('request', None) request = self.context.get('request', None)