-
-
Notifications
You must be signed in to change notification settings - Fork 485
error: "HttpRequest" has no attribute "user" #70
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
Comments
It would be great to have a general solution for this -- Django has several things which are added by middleware (the other one which immediately springs to mind is the |
I don't know if it makes sense to do, but I tried changing my request type to WSGIRequest, which subclasses HTTPRequest and adds a user attribute (as AbstractUser). |
It could be added as a plugin, like, "if some |
Hi there,
I have the following code:
Which results in:
Which is probably because the HttpRequest class doesn't really have the user but it is almost always added through the authentication middleware (either User or AnonymousUser).
So how do I fix this?
The text was updated successfully, but these errors were encountered: