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:
|
view = self.registry[model_label].from_scope( |
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