Skip to content

Commit

Permalink
fix bug contest_object is none
Browse files Browse the repository at this point in the history
  • Loading branch information
leduythuccs committed Sep 19, 2024
1 parent 772836a commit 8e6fa01
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion judge/models/submission.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,12 +200,13 @@ def update_credit(self, consumed_credit):
organizations = problem.organizations.all()

if len(organizations) == 0:
contest_object = None
try:
contest_object = self.contest_object
except AttributeError:
pass

if contest_object.is_organization_private:
if contest_object is not None and contest_object.is_organization_private:
organizations = contest_object.organizations.all()

for organization in organizations:
Expand Down

0 comments on commit 8e6fa01

Please sign in to comment.