Skip to content

Commit 405f2a4

Browse files
committed
Log reasons for rejecting a submission
Otherwise, the text of the InvalidFilesOrLanguage exception is neither logged nor sent to the user.
1 parent 39b2420 commit 405f2a4

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

cms/server/contest/submission/workflow.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,8 @@ def accept_submission(
190190
files, language = match_files_and_language(
191191
received_files, language_name, required_codenames,
192192
contest.languages)
193-
except InvalidFilesOrLanguage:
193+
except InvalidFilesOrLanguage as err:
194+
logger.info(f'Submission rejected: {err}')
194195
raise UnacceptableSubmission(
195196
N_("Invalid submission format!"),
196197
N_("Please select the correct files."))
@@ -382,7 +383,8 @@ def accept_user_test(
382383
files, language = match_files_and_language(
383384
received_files, language_name, required_codenames,
384385
contest.languages)
385-
except InvalidFilesOrLanguage:
386+
except InvalidFilesOrLanguage as err:
387+
logger.info(f'Test rejected: {err}')
386388
raise UnacceptableUserTest(
387389
N_("Invalid test format!"),
388390
N_("Please select the correct files."))

0 commit comments

Comments
 (0)