Skip to content

Commit

Permalink
Fix bug #95
Browse files Browse the repository at this point in the history
Signed-off-by: tdruez <tdruez@nexb.com>
  • Loading branch information
tdruez committed Aug 23, 2024
1 parent 92cab77 commit 050d360
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions component_catalog/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -2675,7 +2675,7 @@ def range_to_values(self, range_str):
min_str, max_str = score.split('-')
return float(min_str.strip()), float(max_str.strip())
except Exception:
return None, None
return

@classmethod
def create_from_data(cls, dataspace, data, validate=False, affecting=None):
Expand All @@ -2691,8 +2691,9 @@ def create_from_data(cls, dataspace, data, validate=False, affecting=None):
for score in reference.get("scores", [])
]
scores = cls.get_severity_scores(severities)
data["lowest_score"] = min(scores)
data["highest_score"] = max(scores)
if scores:
data["lowest_score"] = min(scores)
data["highest_score"] = max(scores)

instance = super().create_from_data(user=dataspace, data=data, validate=False)

Expand Down

0 comments on commit 050d360

Please sign in to comment.