From ba5b66931ae014df4bf52e55754dab8dc8384d7c Mon Sep 17 00:00:00 2001 From: Daniel Axtens Date: Sat, 12 May 2018 03:00:44 +1000 Subject: [PATCH] REST: Disable control for filtering patches by series in web view As with the events view, creating and rendering the control for filtering patches by series creates a massive slowdown. It's a little sad not to be able to do this in the web UI as filtering patches by series does make sense, but hopefully people figure out you can still do it, just not from the web view. Signed-off-by: Daniel Axtens Signed-off-by: Stephen Finucane --- patchwork/api/filters.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/patchwork/api/filters.py b/patchwork/api/filters.py index 7e818954..73353d90 100644 --- a/patchwork/api/filters.py +++ b/patchwork/api/filters.py @@ -168,7 +168,10 @@ class Meta: class CoverLetterFilterSet(TimestampMixin, FilterSet): project = ProjectFilter(queryset=Project.objects.all()) - series = BaseFilter(queryset=Project.objects.all()) + # NOTE(stephenfin): We disable the select-based HTML widgets for these + # filters as the resulting query is _huge_ + series = BaseFilter(queryset=Project.objects.all(), + widget=MultipleHiddenInput) submitter = PersonFilter(queryset=Person.objects.all()) class Meta: @@ -179,7 +182,10 @@ class Meta: class PatchFilterSet(TimestampMixin, FilterSet): project = ProjectFilter(queryset=Project.objects.all()) - series = BaseFilter(queryset=Series.objects.all()) + # NOTE(stephenfin): We disable the select-based HTML widgets for these + # filters as the resulting query is _huge_ + series = BaseFilter(queryset=Series.objects.all(), + widget=MultipleHiddenInput) submitter = PersonFilter(queryset=Person.objects.all()) delegate = UserFilter(queryset=User.objects.all()) state = StateFilter(queryset=State.objects.all())