From 16f23b6e011fdf1eafae164949bf702949b3bc5b Mon Sep 17 00:00:00 2001 From: cuom1999 Date: Tue, 1 Nov 2022 13:40:18 -0500 Subject: [PATCH] Fix bug --- judge/views/submission.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/judge/views/submission.py b/judge/views/submission.py index aebf9c7..d71ef89 100644 --- a/judge/views/submission.py +++ b/judge/views/submission.py @@ -812,10 +812,13 @@ class UserContestSubmissionsAjax(UserContestSubmissions): template_name = "submission/user-ajax.html" def contest_time(self, s): - if s.contest.participation.live: - if self.contest.time_limit: - return s.date - s.contest.participation.real_start - return s.date - self.contest.start_time + try: + if s.contest.participation.live: + if self.contest.time_limit: + return s.date - s.contest.participation.real_start + return s.date - self.contest.start_time + except RelatedObjectDoesNotExist: + return None return None def get_context_data(self, **kwargs):