From: Michael Tremer Date: Mon, 17 Feb 2025 11:45:52 +0000 (+0000) Subject: jobs: Fix halted check X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b0639cc26408d27859a4c563b681ff373f80da2b;p=pbs.git jobs: Fix halted check Only scratch builds can be halted. Signed-off-by: Michael Tremer --- diff --git a/src/buildservice/jobs.py b/src/buildservice/jobs.py index a424f206..9e53516c 100644 --- a/src/buildservice/jobs.py +++ b/src/buildservice/jobs.py @@ -735,9 +735,10 @@ class Job(database.Base, database.BackendMixin, database.SoftDeleteMixin): async def is_halted(self): # Only scratch builds can be halted - if not self.build.owner: + if not self.build.is_scratch(): return False + # If the job is either running, finished or aborted, it cannot be halted if self.is_running() or self.has_finished() or self.is_aborted(): return False