Skip to content

"Test Type" filter dropdown includes inactive test types #14161

@AndreyMZ

Description

@AndreyMZ

Steps to reproduce

  1. Log in to DefectDojo: https://demo.defectdojo.org/
  2. Deactivate a test type:
    1. Go to Engagements -> Test Types -> some test type, e.g., "API Test".
    2. Switch off Active.
    3. Click Submit.
  3. Switch on Filter String Matching Optimization:
    1. Go to Configuration -> System Settings.
    2. Switch on Filter String Matching Optimization.
    3. Click Submit.
  4. Go to Findings -> Open Findings.
  5. Open the filters, click the "Test Type" dropdown.

Actual result

"API Test" is in the list.

Expected result

There is no "API Test" in the list.

Root cause

dojo.filters.FindingFilter.__init__ runs the following code, and dojo.filters.FindingFilterWithoutObjectLookups.__init__ does not.

if "test__test_type" in self.form.fields:
self.form.fields["test__test_type"].queryset = get_visible_scan_types()

Possible solution

Move the code to dojo.filters.FindingFilterHelper.__init__.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions