From e3c29eeb8f71ea4f104ab313599c18f45dbd6f67 Mon Sep 17 00:00:00 2001 From: Pedro Souza Date: Wed, 30 Oct 2024 14:53:51 -0300 Subject: [PATCH] Added reviewers displayed on findings pages --- dojo/finding/views.py | 3 +++ dojo/templates/dojo/findings_list_snippet.html | 18 ++++++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/dojo/finding/views.py b/dojo/finding/views.py index 0c0d78d6cc..647bcccb43 100644 --- a/dojo/finding/views.py +++ b/dojo/finding/views.py @@ -135,6 +135,9 @@ def prefetch_for_findings(findings, prefetch_type="all", exclude_untouched=True) if isinstance( findings, QuerySet, ): # old code can arrive here with prods being a list because the query was already executed + prefetched_findings = prefetched_findings.prefetch_related( + "reviewers", + ) prefetched_findings = prefetched_findings.prefetch_related("reporter") prefetched_findings = prefetched_findings.prefetch_related( "jira_issue__jira_project__jira_instance", diff --git a/dojo/templates/dojo/findings_list_snippet.html b/dojo/templates/dojo/findings_list_snippet.html index eb0c2d7135..51e85ab8d1 100644 --- a/dojo/templates/dojo/findings_list_snippet.html +++ b/dojo/templates/dojo/findings_list_snippet.html @@ -384,6 +384,11 @@

{% trans "Planned Remediation" %} + {% if filter_name != 'Closed' %} + + {% trans "Reviewers" %} + + {% endif %} {% endblock header %} @@ -699,6 +704,16 @@

{% if finding.planned_remediation_date %}{{ finding.planned_remediation_date }}{% endif %} + {% if filter_name != 'Closed' %} + + {% if finding.reviewers %} + {% for reviewer in finding.reviewers.all %} + {{reviewer.get_full_name}} + {% if not forloop.last %}
{% endif %} + {% endfor %} + {% endif %} + + {% endif %} {% endblock body %} {% endfor %} @@ -779,6 +794,9 @@

{% endif %} { "data": "service" }, { "data": "planned_remediation_date" }, + {% if filter_name != 'Closed' %} + { "data": "reviewers" }, + {% endif %} ]; {% endblock datatables_columns %}