Use smart_text rather than naive forcing-to-unicode for state reading

This commit is contained in:
Andrew Godwin 2014-08-07 22:33:42 +10:00
parent 57b60f9f93
commit 157c42a976
1 changed files with 2 additions and 2 deletions

View File

@ -8,7 +8,7 @@ from django.db.models.fields.related import do_pending_lookups
from django.db.models.fields.proxy import OrderWrt
from django.conf import settings
from django.utils import six
from django.utils.encoding import force_text
from django.utils.encoding import force_text, smart_text
from django.utils.module_loading import import_string
@ -255,7 +255,7 @@ class ModelState(object):
@classmethod
def force_text_recursive(cls, value):
if isinstance(value, six.string_types):
return six.text_type(value)
return smart_text(value)
elif isinstance(value, list):
return [cls.force_text_recursive(x) for x in value]
elif isinstance(value, tuple):