Fix: desc parameter parsing (#8229)

### What problem does this PR solve?

- Fix boolean parsing for 'desc' parameter in kb_app.py to properly
handle string values

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
Liu An 2025-06-12 19:17:47 +08:00 committed by GitHub
parent 1ab0f52832
commit 99725444f1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -179,7 +179,10 @@ def list_kbs():
items_per_page = int(request.args.get("page_size", 0))
parser_id = request.args.get("parser_id")
orderby = request.args.get("orderby", "create_time")
desc = request.args.get("desc", True)
if request.args.get("desc", "true").lower() == "false":
desc = False
else:
desc = True
req = request.get_json()
owner_ids = req.get("owner_ids", [])