From c1ff69721adf5c8de9e11dd9d4124d8e5e954862 Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Sun, 6 Apr 2025 15:14:57 -0700 Subject: [PATCH] refac --- backend/open_webui/routers/files.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/backend/open_webui/routers/files.py b/backend/open_webui/routers/files.py index bfdb2be6a..3a7b8d477 100644 --- a/backend/open_webui/routers/files.py +++ b/backend/open_webui/routers/files.py @@ -162,17 +162,16 @@ def upload_file( @router.get("/", response_model=list[FileModelResponse]) -async def list_files( - user=Depends(get_verified_user), include_content: bool = Query(True) -): +async def list_files(user=Depends(get_verified_user), content: bool = Query(True)): if user.role == "admin": files = Files.get_files() else: files = Files.get_files_by_user_id(user.id) - if not include_content: + if not content: for file in files: - file.data["content"] = "" + del file.data["content"] + return files