Skip to content

Commit 37f1312

Browse files
authored
Merge pull request #2175 from aboutcode-org/fix_views_bug
Fix views bug
2 parents 928b773 + fd2040f commit 37f1312

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

vulnerabilities/templates/package_details_v2.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
<div id="tab-content">
4646
<div class="tab-div is-active" data-content="essentials">
4747
<div class="tab-nested-div mb-1 pb-0">
48-
{% if affected_by_advisories|length != 0 %}
48+
{% if affected_by_advisories_v2|length != 0 %}
4949
<div class="pl-3 pr-3 mb-5 floating-purl pb-0">
5050
{% else %}
5151
<div class="pl-3 pr-3 mb-5 floating-purl pb-2">
@@ -82,7 +82,7 @@
8282
</tbody>
8383
</table>
8484
</div>
85-
{% if affected_by_advisories|length != 0 %}
85+
{% if affected_by_advisories_v2|length != 0 %}
8686

8787
<div class="pl-3 pr-3 mb-6 non-vuln pb-0">
8888
<table class="table vcio-table width-100-pct">

vulnerabilities/views.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -506,15 +506,15 @@ def get_context_data(self, **kwargs):
506506
epss_data = None
507507
epss_advisory = None
508508
if not epss_severity:
509-
related_epss_advisory = (
509+
epss_advisory = (
510510
advisory.related_advisory_severities.filter(
511511
datasource_id=EPSSImporterPipeline.pipeline_id
512512
)
513513
.latest_per_avid()
514514
.first()
515515
)
516-
epss_advisory = related_epss_advisory
517-
epss_severity = related_epss_advisory.severities.filter(scoring_system="epss").first()
516+
if epss_advisory:
517+
epss_severity = epss_advisory.severities.filter(scoring_system="epss").first()
518518
if epss_severity:
519519
# If the advisory itself does not have EPSS severity, but has a related advisory with EPSS severity, we use the related advisory's EPSS severity and URL as the source of EPSS data.
520520
epss_data = {

0 commit comments

Comments
 (0)