From 42f46a45190c8d1e7d2be94d50c7f87fcec5aace Mon Sep 17 00:00:00 2001 From: Sanghun Lee Date: Wed, 15 Jan 2025 18:35:44 +0900 Subject: [PATCH] fix: allow VFolder id as name parameter in API --- src/ai/backend/manager/api/vfolder.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/ai/backend/manager/api/vfolder.py b/src/ai/backend/manager/api/vfolder.py index bd8fe36ecc..37f893ba16 100644 --- a/src/ai/backend/manager/api/vfolder.py +++ b/src/ai/backend/manager/api/vfolder.py @@ -248,7 +248,11 @@ async def resolve_vfolder_rows( match folder_id_or_name: case str(): - extra_vf_conds = vfolders.c.name == folder_id_or_name + try: + folder_id = uuid.UUID(folder_id_or_name) + extra_vf_conds = vfolders.c.id == folder_id + except ValueError: + extra_vf_conds = vfolders.c.name == folder_id_or_name case uuid.UUID(): extra_vf_conds = vfolders.c.id == folder_id_or_name case _: