From 8cf722c1d0773b3d7ed368d0f361be5cfd00c489 Mon Sep 17 00:00:00 2001 From: Michael Vasseur <14887731+vmcj@users.noreply.github.com> Date: Thu, 13 Nov 2025 17:33:54 +0100 Subject: [PATCH] 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. --- misc-tools/import-contest.in | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/misc-tools/import-contest.in b/misc-tools/import-contest.in index dd999ad3e4..3529321c7a 100755 --- a/misc-tools/import-contest.in +++ b/misc-tools/import-contest.in @@ -188,6 +188,11 @@ if os.path.exists('problems.yaml') or os.path.exists('problems.json') or os.path print('Importing problems.') if cid is None: + existing_contests = dj_utils.do_api_request('contests') + if existing_contests: + print("The DOMjudge server already has these contests:") + for c in existing_contests: + print(f"'{c['name']}' with cid: {c['id']}") cid = answer = input('Please specify the contest id: ') if not problems_imported: