From 7087c123551e7e0eddc807ba750c38d6fc3e7942 Mon Sep 17 00:00:00 2001 From: Pierre Equoy Date: Fri, 15 Nov 2024 16:02:36 +0100 Subject: [PATCH] Prevent mandatory jobs from being added to the rejected jobs When user de-selects jobs in the UI, they may de-select mandatory jobs. These jobs, even if de-selected, will still be added to the list of jobs to run later on, and will be executed. Therefore, they should not be part of the rejected jobs list. --- checkbox-ng/plainbox/impl/session/assistant.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/checkbox-ng/plainbox/impl/session/assistant.py b/checkbox-ng/plainbox/impl/session/assistant.py index fd5a449fc..9044f7c23 100644 --- a/checkbox-ng/plainbox/impl/session/assistant.py +++ b/checkbox-ng/plainbox/impl/session/assistant.py @@ -1010,7 +1010,7 @@ def use_alternate_selection(self, selection: "Iterable[str]"): for job_id in self.get_static_todo_list(): if job_id in selection: desired_job_list.append(self._context.get_unit(job_id, "job")) - else: + elif job_id not in self.get_mandatory_jobs(): self._metadata.rejected_jobs.append(job_id) self._context.state.update_desired_job_list(desired_job_list)