From: Michael Tremer Date: Thu, 6 Feb 2025 15:00:10 +0000 (+0000) Subject: jobs: Ensure that we have packages when a job finishes X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8d49e73fac509ce7827482cff70967deec811602;p=pbs.git jobs: Ensure that we have packages when a job finishes Signed-off-by: Michael Tremer --- diff --git a/src/web/jobs.py b/src/web/jobs.py index 973e1557..656133b4 100644 --- a/src/web/jobs.py +++ b/src/web/jobs.py @@ -28,7 +28,11 @@ class APIv1FinishedHandler(base.APIMixin, base.BackendMixin, tornado.web.Request logfile = await self.get_argument_upload("logfile") # Fetch the packages - packages = await self.get_argument_uploads("packages") + packages = await self.get_argument_uploads("package") + + # If the job has been successful there must be packages + if success and not packages: + raise tornado.web.HTTPError(400, "No packages") # Mark the job as finished async with await self.db.transaction():