From f9ab66f51a52388a4eb084c8f69044e79bf5cb04 Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Fri, 30 Jan 2026 00:46:42 +0400 Subject: [PATCH] refac Co-Authored-By: Hsienz <55347238+hsienz@users.noreply.github.com> --- backend/open_webui/routers/files.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/backend/open_webui/routers/files.py b/backend/open_webui/routers/files.py index 505564771..8b17dc406 100644 --- a/backend/open_webui/routers/files.py +++ b/backend/open_webui/routers/files.py @@ -282,7 +282,11 @@ def upload_file_handler( }, "meta": { "name": name, - "content_type": file.content_type if isinstance(file.content_type, str) else None, + "content_type": ( + file.content_type + if isinstance(file.content_type, str) + else None + ), "size": len(contents), "data": file_metadata, }, @@ -577,7 +581,7 @@ class ContentForm(BaseModel): @router.post("/{id}/data/content/update") -async def update_file_data_content_by_id( +def update_file_data_content_by_id( request: Request, id: str, form_data: ContentForm,