From ecfbd56d65969a3778c3a588e74c4c60bd62cec9 Mon Sep 17 00:00:00 2001 From: cuom1999 Date: Sat, 29 May 2021 21:43:16 -0500 Subject: [PATCH] Fix submission display if input/output not exist --- judge/views/submission.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/judge/views/submission.py b/judge/views/submission.py index d130062..faa4d60 100644 --- a/judge/views/submission.py +++ b/judge/views/submission.py @@ -156,8 +156,10 @@ def get_cases_data(submission): for case in testcases: if case.type != 'C': continue count += 1 - problem_data[count] = {'input': case_data[case.input_file], - 'answer': case_data[case.output_file]} + problem_data[count] = { + 'input': case_data[case.input_file] if case.input_file else '', + 'answer': case_data[case.output_file] if case.output_file else '', + } return problem_data