Skip to content

Commit 5f88a5f

Browse files
🐛 Fix "Test Type" filter dropdown includes inactive test types #14161 (#14166)
1 parent 2a9a747 commit 5f88a5f

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

dojo/filters.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1889,6 +1889,8 @@ class FindingFilterHelper(FilterSet):
18891889

18901890
def __init__(self, *args, **kwargs):
18911891
super().__init__(*args, **kwargs)
1892+
if "test__test_type" in self.form.fields:
1893+
self.form.fields["test__test_type"].queryset = get_visible_scan_types()
18921894

18931895
def set_date_fields(self, *args: list, **kwargs: dict):
18941896
date_input_widget = forms.DateInput(attrs={"class": "datepicker", "placeholder": "YYYY-MM-DD"}, format="%Y-%m-%d")
@@ -2075,9 +2077,6 @@ def __init__(self, *args, **kwargs):
20752077
# Don't show the product filter on the product finding view
20762078
self.set_related_object_fields(*args, **kwargs)
20772079

2078-
if "test__test_type" in self.form.fields:
2079-
self.form.fields["test__test_type"].queryset = get_visible_scan_types()
2080-
20812080
def set_related_object_fields(self, *args: list, **kwargs: dict):
20822081
finding_group_query = Finding_Group.objects.all()
20832082
if self.pid is not None:

0 commit comments

Comments
 (0)