Skip to content

Commit 26aeefa

Browse files
committed
List existing contests as hint during import-contest
In 99% of the cases the user wants the last added contest but we choose to make that choice explicit to prevent importing problems into the wrong contest.
1 parent e45daf5 commit 26aeefa

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

misc-tools/import-contest.in

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,11 @@ if os.path.exists('problems.yaml') or os.path.exists('problems.json') or os.path
188188
print('Importing problems.')
189189

190190
if cid is None:
191+
existing_contests = dj_utils.do_api_request('contests')
192+
if existing_contests:
193+
print("The DOMjudge server already has these contests:")
194+
for c in existing_contests:
195+
print(f"'{c['name']}' with cid: {c['id']}")
191196
cid = answer = input('Please specify the contest id: ')
192197

193198
if not problems_imported:

0 commit comments

Comments
 (0)