Skip to content

Commit

Permalink
Added reviewers displayed on findings pages (#11165)
Browse files Browse the repository at this point in the history
Co-authored-by: Pedro Souza <[email protected]>
  • Loading branch information
pedrohdjs and Pedro Souza authored Nov 12, 2024
1 parent 6ec33d0 commit ab2a2c0
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
3 changes: 3 additions & 0 deletions dojo/finding/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
18 changes: 18 additions & 0 deletions dojo/templates/dojo/findings_list_snippet.html
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,11 @@ <h3 class="has-filters">
<th>
{% trans "Planned Remediation" %}
</th>
{% if filter_name != 'Closed' %}
<th>
{% trans "Reviewers" %}
</th>
{% endif %}
{% endblock header %}
</tr>
</thead>
Expand Down Expand Up @@ -699,6 +704,16 @@ <h3 class="has-filters">
<td class="nowrap">
{% if finding.planned_remediation_date %}{{ finding.planned_remediation_date }}{% endif %}
</td>
{% if filter_name != 'Closed' %}
<td class="nowrap">
{% if finding.reviewers %}
{% for reviewer in finding.reviewers.all %}
{{reviewer.get_full_name}}
{% if not forloop.last %}<br>{% endif %}
{% endfor %}
{% endif %}
</td>
{% endif %}
{% endblock body %}
</tr>
{% endfor %}
Expand Down Expand Up @@ -779,6 +794,9 @@ <h3 class="has-filters">
{% endif %}
{ "data": "service" },
{ "data": "planned_remediation_date" },
{% if filter_name != 'Closed' %}
{ "data": "reviewers" },
{% endif %}
];
{% endblock datatables_columns %}
</script>
Expand Down

0 comments on commit ab2a2c0

Please sign in to comment.