From 0329781ff28ef6d75cc2d3ee1f43b07f48513fbe Mon Sep 17 00:00:00 2001 From: Daniel Mach Date: Fri, 6 Feb 2026 14:09:01 +0100 Subject: [PATCH] Fix how get_request_collection() filters the projects and packages --- osc/core.py | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/osc/core.py b/osc/core.py index 1f02608f..a93eba11 100644 --- a/osc/core.py +++ b/osc/core.py @@ -2455,7 +2455,7 @@ def get_request_collection( # post-process results until we switch back to the /search/request # which seems to be more suitable for such queries - exclude = False + match = False for action in r.actions: src_project = getattr(action, "src_project", None) src_package = getattr(action, "src_package", None) @@ -2464,27 +2464,28 @@ def get_request_collection( # skip if neither of source and target project matches if "project" in query and query["project"] not in (src_project, tgt_project): - exclude = True - break + continue # skip if neither of source and target package matches if "package" in query and query["package"] not in (src_package, tgt_package): - exclude = True - break + continue if not conf.config["include_request_from_project"]: + # skip if include_request_from_project=1 and the query matches the source prj/pac if "project" in query and "package" in query: if (src_project, src_package) == (query["project"], query["package"]): - exclude = True - break + continue + # skip if include_request_from_project=1 and the query matches the source prj elif "project" in query: if src_project == query["project"]: - exclude = True - break - if exclude: - continue + continue + + match = True + break + + if match: + requests.append(r) - requests.append(r) return requests