Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Django custom user models in devserver.modules.request.SessionInfoModule #73

Open
jesselathamdev opened this issue Feb 21, 2013 · 0 comments

Comments

@jesselathamdev
Copy link

Hey there,

Found an error which is thrown due to the assumption that request.user.username will always exist in devserver.modules.request.SessionInfoModule. In my custom user model configuration I've replaced 'username' with 'email'.


Traceback (most recent call last):
File "/Users/jesselatham/Envs/portfolio/src/django/django/contrib/staticfiles/handlers.py", line 72, in call
return self.application(environ, start_response)
File "/Users/jesselatham/Envs/portfolio/src/django/django/core/handlers/wsgi.py", line 255, in call
response = self.get_response(request)
File "/Users/jesselatham/Envs/portfolio/src/django/django/core/handlers/base.py", line 191, in get_response
response = self.handle_uncaught_exception(request, resolver, sys.exc_info())
File "/Users/jesselatham/Envs/portfolio/src/django/django/core/handlers/base.py", line 217, in handle_uncaught_exception
return debug.technical_500_response(request, *exc_info)
File "/Users/jesselatham/Envs/portfolio/src/django/django/core/handlers/base.py", line 187, in get_response
response = middleware_method(request, response)
File "/Users/jesselatham/Envs/portfolio/src/django-devserver/devserver/middleware.py", line 47, in process_response
mod.process_response(request, response)
File "/Users/jesselatham/Envs/portfolio/src/django-devserver/devserver/modules/request.py", line 23, in process_response
user = '%s (id:%s)' % (request.user.username, request.user.pk)
File "/Users/jesselatham/Envs/portfolio/src/django/django/utils/functional.py", line 202, in inner
return func(self._wrapped, *args)
AttributeError: 'User' object has no attribute 'username'


I've able to successfully patch this line on my end by changing 'username' to 'email' to keep it working.

For what it's work this is the dev server that I've been looking for!

Thanks,
Jess

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant