summaryrefslogtreecommitdiff
path: root/django
diff options
context:
space:
mode:
authorAymeric Augustin <aymeric.augustin@m4x.org>2012-08-11 22:15:05 +0200
committerAymeric Augustin <aymeric.augustin@m4x.org>2012-08-12 14:44:40 +0200
commitdbb63e56eaa6e2e2a574d4327464332b3ef9f970 (patch)
tree7f89e1d70232ff10c6c0c05108289604ad91cd41 /django
parent9e7b5ba50fd9c23876b0a17a03e6875a6899b7c6 (diff)
[py3] Avoided returning bytes in Model.__str__
on Python 3.
Diffstat (limited to 'django')
-rw-r--r--django/db/models/base.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/django/db/models/base.py b/django/db/models/base.py
index 569b8e876c..3a569c805a 100644
--- a/django/db/models/base.py
+++ b/django/db/models/base.py
@@ -407,7 +407,7 @@ class Model(six.with_metaclass(ModelBase, object)):
return smart_bytes('<%s: %s>' % (self.__class__.__name__, u))
def __str__(self):
- if hasattr(self, '__unicode__'):
+ if not six.PY3 and hasattr(self, '__unicode__'):
return force_text(self).encode('utf-8')
return '%s object' % self.__class__.__name__