You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The text was updated successfully, but these errors were encountered:
e-kondr01
changed the title
RealtimeMixin's from_scope doesn't set user on djangorestframework==3.13.1
RealtimeMixin's from_scope doesn't set request's user on djangorestframework==3.13.1
Sep 19, 2022
e-kondr01
changed the title
RealtimeMixin's from_scope doesn't set request's user on djangorestframework==3.13.1
RealtimeMixin's from_scope() doesn't set request's user on djangorestframework==3.13.1
Sep 19, 2022
Some backgound: I was trying to figure out why my view's queryset doesn't get filtered by user.
I found out that after this line:
django-rest-live/rest_live/consumers.py
Line 116 in 572689f
view.request.user is AnonymousUser, but self.scope.get("user") is the correct user.
When I changed this line:
https://github.com/pennlabs/django-rest-live/blob/master/rest_live/mixins.py#L84
to:
base_request._user = scope.get("user", None)
the bug was gone.
This was the line that made me try the change above:
https://github.com/encode/django-rest-framework/blob/master/rest_framework/request.py#L225
My PR:
#22
The text was updated successfully, but these errors were encountered: