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):