From 93af349bf7101bd22821a2ca3b5339faf7c9ffd3 Mon Sep 17 00:00:00 2001 From: Krishnan Shankar Date: Wed, 18 Dec 2024 21:43:09 -0600 Subject: [PATCH] Hotfix: Handle null point overrides in submission comments This fixes the below production error: ``` File ".../tin/tin/apps/submissions/models.py", line 136, in point_override return sum(c.point_override for c in self.comments.all()) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: unsupported operand type(s) for +: 'int' and 'NoneType' ``` --- tin/apps/submissions/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tin/apps/submissions/models.py b/tin/apps/submissions/models.py index 42649b74..513a9350 100644 --- a/tin/apps/submissions/models.py +++ b/tin/apps/submissions/models.py @@ -133,7 +133,7 @@ def points_possible(self): @property def point_override(self): - return sum(c.point_override for c in self.comments.all()) + return sum(c.point_override for c in self.comments.all() if c.point_override) @property def points(self):