From e1a38d42c33923fd3a41dce4c371bc2f52945e16 Mon Sep 17 00:00:00 2001 From: cuom1999 Date: Wed, 11 Oct 2023 20:45:32 -0500 Subject: [PATCH] Use better field --- judge/models/submission.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/judge/models/submission.py b/judge/models/submission.py index 842b627..00c5941 100644 --- a/judge/models/submission.py +++ b/judge/models/submission.py @@ -254,9 +254,8 @@ class Submission(models.Model): if self.problem.is_public and user.has_perm("judge.view_public_submission"): return True - if hasattr( - self, "contest" - ) and self.contest.participation.contest.is_editable_by(user): + contest = self.contest_object + if contest and contest.is_editable_by(user): return True return False