Opened 17 years ago

Last modified 17 years ago

#4751 closed

anonymous user cannot be converted to string — at Initial Version

Reported by: canburak@… 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

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 (0)

Note: See TracTickets for help on using tickets.
Back to Top