]> git.ipfire.org Git - thirdparty/patchwork.git/commitdiff
REST: Disable control for filtering patches by series in web view
authorDaniel Axtens <dja@axtens.net>
Fri, 11 May 2018 17:00:44 +0000 (03:00 +1000)
committerStephen Finucane <stephen@that.guru>
Tue, 15 May 2018 13:00:12 +0000 (14:00 +0100)
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 <dja@axtens.net>
Signed-off-by: Stephen Finucane <stephen@that.guru>
patchwork/api/filters.py

index 7e818954639a1a3613e652d875c87f1d4bb65bb3..73353d900a94e3e25c274b60c7191442a75f33bc 100644 (file)
@@ -168,7 +168,10 @@ class SeriesFilterSet(TimestampMixin, FilterSet):
 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 CoverLetterFilterSet(TimestampMixin, FilterSet):
 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())