Skip to content

Commit 60d8181

Browse files
niklaciveluca93
authored andcommitted
Use the filenames of the contestant as a default submission comment
It is very useful for the scientific commitee to see it in the Comment column of the submissions page in the admin website. This column was mostly unused and empty in the past.
1 parent 05a3b8d commit 60d8181

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

cms/server/contest/submission/workflow.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,11 +219,15 @@ def accept_submission(
219219
logger.info("All files stored for submission sent by %s",
220220
participation.user.username)
221221

222+
# Use the filenames of the contestant as a default submission comment
223+
received_filenames_joined = ",".join([file.filename for file in received_files])
224+
222225
submission = Submission(
223226
timestamp=timestamp,
224227
language=language.name if language is not None else None,
225228
task=task,
226229
participation=participation,
230+
comment=received_filenames_joined,
227231
official=official)
228232
sql_session.add(submission)
229233

cmstestsuite/unit_tests/server/contest/submission/workflow_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ def setUp(self):
8383
self.tornado_files = sentinel.tornado_files
8484
self.language_name = sentinel.language_name
8585
self.official = True
86-
self.received_files = sentinel.received_files
86+
self.received_files = []
8787
self.files = {"foo.%l": FOO_CONTENT}
8888
# Multiple extensions, primary one doesn't start with a period.
8989
self.language = make_language("MockLanguage", ["mock.1", ".mock2"])

0 commit comments

Comments
 (0)