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

'NoneType' object has no attribute 'user' #8

Open
MitchK opened this issue Apr 6, 2014 · 6 comments
Open

'NoneType' object has no attribute 'user' #8

MitchK opened this issue Apr 6, 2014 · 6 comments

Comments

@MitchK
Copy link

MitchK commented Apr 6, 2014

Hi,

I have integrated django-conversejs as it was described in the tutorial.

I get this error: 'NoneType' object has no attribute 'user' (utils.py in get_conversejs_context, line 21)

Any ideas? Thank you.

@DrAzraelTod
Copy link

had the same problem
was solved by adding the current request under the key 'request' to the context before calling template.render(context)

this should be noted in the howto

@seocam
Copy link
Member

seocam commented Oct 20, 2014

The request should be added to the context by using the django.core.context_processors.request context processor.

@DrAzraelTod or @MitchK could you please add to the README and do a Pull-Request?

Thanks!

@DrAzraelTod
Copy link

i wouldn't edit the readme until i got it to work
after solving this i ran into the next problem and gave up for that weekend
maybe later, but it would be better if you did it yourself, since you seem to know why you want to do it that way.

@ptchankue
Copy link

Has anyone solve that issue? I am trying to get django-conversejs working with my chat app. I have the exact problem described in this post:
I can't implement @seocam answer as I don't know in which file should I import the context processor.
Can anyone help?

@vhf
Copy link
Contributor

vhf commented Feb 1, 2015

@ptchankue Does this help?

@seocam
Copy link
Member

seocam commented Feb 2, 2015

I believe the code could be improved by getting user from context instead of request. The user is added to the context by django.contrib.auth.context_processors.auth which is a default context processor. If it works the code would be simplified and we wouldn't need to add a new step in the install manual.

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

No branches or pull requests

5 participants