Skip to content

Commit

Permalink
Update get_vulnerability() method #1228
Browse files Browse the repository at this point in the history
Reference: #1228

Signed-off-by: John M. Horan <[email protected]>
  • Loading branch information
johnmhoran committed Nov 22, 2023
1 parent 5eaa9ce commit 4ce5d51
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions vulnerabilities/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,9 @@ def get_affected_vulnerabilities(self, package):
def get_vulnerability(self, vuln, affected_vulnerabilities):
affected_vulnerability = {}

if vuln.get("vulnerability"):
affected_vulnerability["vulnerability"] = vuln.get("vulnerability").vulnerability_id
vulnerability = vuln.get("vulnerability")
if vulnerability:
affected_vulnerability["vulnerability"] = vulnerability.vulnerability_id
affected_vulnerabilities.append(affected_vulnerability)

affected_by_vulnerabilities = serializers.SerializerMethodField("get_affected_vulnerabilities")
Expand Down

0 comments on commit 4ce5d51

Please sign in to comment.