mirror of
https://github.com/openSUSE/osc.git
synced 2026-03-05 17:01:52 +01:00
Fix how get_request_collection() filters the projects and packages
This commit is contained in:
25
osc/core.py
25
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
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user