if callable(attr):
attr = attr()
if attr:
- return unicode(attr)
+ return force_text(attr)
elif callable(show_user_as):
try:
- return unicode(show_user_as(user))
+ return force_text(show_user_as(user))
except:
pass
- return unicode(user) # default value, or in case of empty attribute or exception
+ return force_text(user) # default value, or in case of empty attribute or exception
-
+# import logging
+# logging.getLogger('django.db.backends').setLevel(logging.DEBUG)
class MessageManager(models.Manager):
"""The manager for Message."""