summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2007-06-04 07:48:51 +0000
committerMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2007-06-04 07:48:51 +0000
commit8d30cdc2672175c77319756b42b12103e1efd350 (patch)
tree1712433a13aa0655581899fb280134dffa9936f9
parentfa689ae9c6eca0e7c68994713ce1f8fedbeb7b6e (diff)
downloaddjango-8d30cdc2672175c77319756b42b12103e1efd350.tar.gz
unicode: Fixed #4472 -- Must return unicode objects from __unicode__ methods.
Lazy translation proxies are not an acceptable substitute. git-svn-id: http://code.djangoproject.com/svn/django/branches/unicode@5421 bcc190cf-cafb-0310-a4f2-bffc1f526a37
-rw-r--r--django/contrib/auth/models.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/django/contrib/auth/models.py b/django/contrib/auth/models.py
index dfe642d818..ac265837f3 100644
--- a/django/contrib/auth/models.py
+++ b/django/contrib/auth/models.py
@@ -281,7 +281,10 @@ class AnonymousUser(object):
pass
def __unicode__(self):
- return _('AnonymousUser')
+ return 'AnonymousUser'
+
+ def __str__(self):
+ return unicode(self).encode('utf-8')
def __eq__(self, other):
return isinstance(other, self.__class__)