Skip to content

Commit

Permalink
Do not report ghost packages as fix for vulnerabilities in APIv2
Browse files Browse the repository at this point in the history
Signed-off-by: Keshav Priyadarshi <git@keshav.space>
  • Loading branch information
keshav-space committed Nov 22, 2024
1 parent 6f36e15 commit a391b44
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions vulnerabilities/api_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,9 @@ def get_affected_by_vulnerabilities(self, obj):
return [vuln.vulnerability_id for vuln in obj.affected_by_vulnerabilities.all()]

def get_fixing_vulnerabilities(self, obj):
# Ghost package should not fix any vulnerability.
if obj.is_ghost:
return []
return [vuln.vulnerability_id for vuln in obj.fixing_vulnerabilities.all()]


Expand Down

0 comments on commit a391b44

Please sign in to comment.