From 8d30cdc2672175c77319756b42b12103e1efd350 Mon Sep 17 00:00:00 2001 From: Malcolm Tredinnick Date: Mon, 4 Jun 2007 07:48:51 +0000 Subject: [PATCH] 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 --- django/contrib/auth/models.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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__)