Skip to content

Commit

Permalink
fix get_global_score for 0
Browse files Browse the repository at this point in the history
None is not 0.0 (thought  bool(None) == bool(0.0))
  • Loading branch information
eric-intuitem committed Apr 25, 2024
1 parent 3731632 commit 9be252d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion backend/core/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -1297,7 +1297,7 @@ def get_global_score(self):
.exclude(is_scored=False)
)
score = requirement_assessments_scored.aggregate(models.Avg("score"))
if score["score__avg"]:
if score["score__avg"] is not None:
return round(score["score__avg"], 1)
return -1

Expand Down

0 comments on commit 9be252d

Please sign in to comment.