Skip to content

Commit f6c0d42

Browse files
committed
fix: avoid duplicates in aliases
1 parent b6c35d9 commit f6c0d42

File tree

1 file changed

+3
-2
lines changed
  • backend/application/import_observations/parsers/cyclone_dx

1 file changed

+3
-2
lines changed

backend/application/import_observations/parsers/cyclone_dx/parser.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -424,8 +424,9 @@ def _get_aliases(self, vulnerability: dict) -> str:
424424
aliases = []
425425
references = vulnerability.get("references", [])
426426
for reference in references:
427-
if reference.get("id"):
428-
aliases.append(reference.get("id"))
427+
reference_id = reference.get("id")
428+
if reference_id and reference_id != vulnerability.get("id") and reference_id not in aliases:
429+
aliases.append(reference_id)
429430
if aliases:
430431
return ", ".join(aliases)
431432
return ""

0 commit comments

Comments
 (0)