Skip to content

Commit 571608b

Browse files
committed
In the heat score calculations, the score cannot be < 0 anymore
1 parent 1f01a4c commit 571608b

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

backend/PyMatcha/utils/tasks.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ def update_heat_scores():
4848
score -= reports_received * REPORTS_MULTIPLIER
4949
score += views * VIEW_MULTIPLIER
5050
score += ceil(messages / MESSAGES_DIVIDER)
51+
if score < 0:
52+
score = 0
5153
user.heat_score = score
5254
user.save()
5355
return f"Updated heat score for user {user.id}: {user.heat_score}."

0 commit comments

Comments
 (0)