feat: switch requests filter for pkgname to "contains"

Use "contains" filtering instead of an exact match
when a package name filter is given.

This makes it easier to find requests for a "group" of packages.

Signed-off-by: moson-mo <mo-son@mailbox.org>
This commit is contained in:
moson-mo 2023-06-10 09:40:35 +02:00
parent 26b2566b3f
commit 1c11c901a2
No known key found for this signature in database
GPG key ID: 4A4760AB4EE15296
2 changed files with 19 additions and 5 deletions

View file

@ -99,9 +99,9 @@ async def requests(
in_filters.append(REJECTED_ID)
filtered = query.filter(PackageRequest.Status.in_(in_filters))
# Name filter
# Name filter (contains)
if filter_pkg_name:
filtered = filtered.filter(PackageBase.Name == filter_pkg_name)
filtered = filtered.filter(PackageBase.Name.like(f"%{filter_pkg_name}%"))
# Additionally filter for requests made from package maintainer
if filter_maintainer_requests: