Opened 18 years ago
Closed 18 years ago
#4751 closed (fixed)
anonymous user cannot be converted to string
| Reported by: | Owned by: | Jacob | |
|---|---|---|---|
| Component: | Uncategorized | Version: | dev |
| Severity: | Keywords: | ||
| Cc: | Triage Stage: | Accepted | |
| Has patch: | no | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description (last modified by )
the code:
class SomeMiddleware: def process_request(self, req): print type(req.user) print type(req.user.__str__()) print req.user.__str__().__class__ print req.user return None
prints out
<class 'django.contrib.auth.models.AnonymousUser'>
<type 'instance'>
django.utils.functional.__proxy__
Traceback (most recent call last):
File "/usr/lib/python2.5/site-packages/django/core/servers/basehttp.py", line 272, in run
self.result = application(self.environ, self.start_response)
File "/usr/lib/python2.5/site-packages/django/core/servers/basehttp.py", line 614, in __call__
return self.application(environ, start_response)
File "/usr/lib/python2.5/site-packages/django/core/handlers/wsgi.py", line 189, in __call__
response = self.get_response(request)
File "/usr/lib/python2.5/site-packages/django/core/handlers/base.py", line 59, in get_response
response = middleware_method(request)
File "/home/can/vc/darcs/baklava/baklava/../baklava/reiloy/middlewares.py", line 13, in process_request
print req.user
TypeError: __str__ returned non-string (type instance)
Change History (2)
comment:1 by , 18 years ago
| Description: | modified (diff) |
|---|---|
| Triage Stage: | Unreviewed → Accepted |
comment:2 by , 18 years ago
| Resolution: | → fixed |
|---|---|
| Status: | new → closed |
Note:
See TracTickets
for help on using tickets.
(Fixed description formatting.)
I thought we'd fixed this. Apparently I am confused, though, and it is only fixed on the Unicode branch.