diff --git a/judge/views/submission.py b/judge/views/submission.py index d71ef89..13cb166 100644 --- a/judge/views/submission.py +++ b/judge/views/submission.py @@ -812,13 +812,10 @@ class UserContestSubmissionsAjax(UserContestSubmissions): template_name = "submission/user-ajax.html" def contest_time(self, s): - 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 + if hasattr(s, "contest") and s.contest.participation.live: + if self.contest.time_limit: + return s.date - s.contest.participation.real_start + return s.date - self.contest.start_time return None def get_context_data(self, **kwargs):