Skip to content

Commit f1c298a

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 871e9c4 commit f1c298a

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
@@ -220,11 +220,15 @@ def accept_submission(
220220
logger.info("All files stored for submission sent by %s",
221221
participation.user.username)
222222

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

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)