Skip to content

Commit

Permalink
feat: round global score to 1 decimal
Browse files Browse the repository at this point in the history
  • Loading branch information
Mohamed-Hacene committed Apr 18, 2024
1 parent 59e61b8 commit e194cfe
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 @@ -1298,7 +1298,7 @@ class Meta:
def get_global_score(self):
requirement_assessments_scored = RequirementAssessment.objects.filter(compliance_assessment=self).exclude(score=None)
score = requirement_assessments_scored.aggregate(models.Avg('score'))
return score['score__avg'] or -1
return round(score['score__avg'], 1) or -1

def get_requirements_status_count(self):
requirements_status_count = []
Expand Down

0 comments on commit e194cfe

Please sign in to comment.