From 72ff021a331a54c522692f717003706a58a5dd88 Mon Sep 17 00:00:00 2001 From: cuom1999 Date: Wed, 5 Aug 2020 08:31:43 -0500 Subject: [PATCH] Optimize rendering testcases status --- judge/views/submission.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/judge/views/submission.py b/judge/views/submission.py index ab5711f..0d4fc4f 100644 --- a/judge/views/submission.py +++ b/judge/views/submission.py @@ -190,7 +190,14 @@ class SubmissionStatus(SubmissionDetailBase): context['last_msg'] = event.last() context['batches'] = group_test_cases(submission.test_cases.all()) context['time_limit'] = submission.problem.time_limit - context['cases_data'] = get_problem_data(submission) + + contest = submission.contest_or_none + prefix_length = 0 + if (contest is not None): + prefix_length = contest.problem.output_prefix_override + if ((contest is None or prefix_length > 0) or self.request.user.is_superuser): + context['cases_data'] = get_problem_data(submission) + try: lang_limit = submission.problem.language_limits.get( language=submission.language)