From 94e8a7b9f6b6bbab1c3f4552e8f1fa1b22b00b0d Mon Sep 17 00:00:00 2001 From: Riku Oja Date: Tue, 22 Jan 2019 13:08:56 +0200 Subject: [PATCH] Remove useless admin_user=false filter that causes massive subquery --- events/api.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/events/api.py b/events/api.py index c70f37ccb..417d1419f 100644 --- a/events/api.py +++ b/events/api.py @@ -1781,12 +1781,8 @@ def filter_queryset(self, queryset): # displays all editable events, including drafts, and public non-editable events queryset = editable_queryset | public_queryset if 'admin_user' in self.request.query_params: - if self.request.query_params['admin_user'] in ('false', 'none'): - # displays only public non-editable events - queryset = public_queryset.difference(editable_queryset) - else: - # displays all editable events, including drafts, but no other public events - queryset = editable_queryset + # displays all editable events, including drafts, but no other public events + queryset = editable_queryset else: # prevent changing events user does not have write permissions (for bulk operations) queryset = self.request.user.get_editable_events(original_queryset)