Skip to content
Browse files

[py3] Avoided returning bytes in Model.__str__

on Python 3.
  • Loading branch information...
1 parent 9e7b5ba commit dbb63e56eaa6e2e2a574d4327464332b3ef9f970 @aaugustin aaugustin committed
Showing with 1 addition and 1 deletion.
  1. +1 −1 django/db/models/
2 django/db/models/
@@ -407,7 +407,7 @@ def __repr__(self):
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__

0 comments on commit dbb63e5

Please sign in to comment.
Something went wrong with that request. Please try again.