Fix Empty Collection WHERE Filter Issue (#23086)

This commit is contained in:
NeatGuyCoding
2025-07-29 11:17:50 +08:00
committed by GitHub
parent 63b6026e6e
commit 47cc951841
5 changed files with 36 additions and 10 deletions

View File

@@ -53,9 +53,10 @@ class AppService:
if args.get("name"):
name = args["name"][:30]
filters.append(App.name.ilike(f"%{name}%"))
if args.get("tag_ids"):
# Check if tag_ids is not empty to avoid WHERE false condition
if args.get("tag_ids") and len(args["tag_ids"]) > 0:
target_ids = TagService.get_target_ids_by_tag_ids("app", tenant_id, args["tag_ids"])
if target_ids:
if target_ids and len(target_ids) > 0:
filters.append(App.id.in_(target_ids))
else:
return None