From e535ac5fb2c0d5b23f2d5b3234635a47b54b016d Mon Sep 17 00:00:00 2001 From: Martin Mares Date: Mon, 7 Jul 2025 15:58:55 +0200 Subject: [PATCH] CWS API: Reply to well-formed, but rejected submissions with HTTP status 422 Closes #1450. --- cms/server/contest/handlers/api.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cms/server/contest/handlers/api.py b/cms/server/contest/handlers/api.py index 5434e3c192..1613288511 100644 --- a/cms/server/contest/handlers/api.py +++ b/cms/server/contest/handlers/api.py @@ -162,7 +162,7 @@ def post(self, task_name: str): except UnacceptableSubmission as e: logger.info("API submission rejected: `%s' - `%s'", e.subject, e.formatted_text) - self.json({"error": e.subject, "details": e.formatted_text}, 400) + self.json({"error": e.subject, "details": e.formatted_text}, 422) else: logger.info( f'API submission accepted: Submission ID {submission.id}')