From b1b47036d756475faad8e03f7eb2f3f93aac2107 Mon Sep 17 00:00:00 2001 From: Tom Christie Date: Wed, 3 Jun 2015 11:53:27 +0100 Subject: [PATCH] Use six.text_type for hyperlink names --- rest_framework/relations.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rest_framework/relations.py b/rest_framework/relations.py index 93c9be8aa..451f2d11a 100644 --- a/rest_framework/relations.py +++ b/rest_framework/relations.py @@ -218,7 +218,7 @@ class HyperlinkedRelatedField(RelatedField): return self.reverse(view_name, kwargs=kwargs, request=request, format=format) def get_name(self, obj): - return str(obj) + return six.text_type(obj) def to_internal_value(self, data): request = self.context.get('request', None)