Skip to content

Commit

Permalink
Hotfix: Handle null point overrides in submission comments
Browse files Browse the repository at this point in the history
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'
```
  • Loading branch information
krishnans2006 committed Dec 19, 2024
1 parent 46efde4 commit 93af349
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tin/apps/submissions/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 93af349

Please sign in to comment.