Skip to content

Commit 37a48e2

Browse files
committed
fix TypeError; use force_text to ensure that lazy instances are resolved to strings
1 parent e8b0a0c commit 37a48e2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

rest_framework_xml/renderers.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from django.utils import six
77
from django.utils.xmlutils import SimplerXMLGenerator
88
from django.utils.six.moves import StringIO
9-
from django.utils.encoding import smart_text
9+
from django.utils.encoding import force_text
1010
from rest_framework.renderers import BaseRenderer
1111

1212

@@ -58,4 +58,4 @@ def _to_xml(self, xml, data):
5858
pass
5959

6060
else:
61-
xml.characters(smart_text(data))
61+
xml.characters(force_text(data))

0 commit comments

Comments
 (0)