From fb083237cd145d6ceeef4cea4d85dbabad4e116b Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Tue, 1 Oct 2024 14:00:19 -0700 Subject: [PATCH] refac --- backend/open_webui/apps/webui/models/files.py | 1 + backend/open_webui/apps/webui/routers/files.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/backend/open_webui/apps/webui/models/files.py b/backend/open_webui/apps/webui/models/files.py index dcb98c20b..69abf6f1a 100644 --- a/backend/open_webui/apps/webui/models/files.py +++ b/backend/open_webui/apps/webui/models/files.py @@ -77,6 +77,7 @@ class FilesTable: **form_data.model_dump(), "user_id": user_id, "created_at": int(time.time()), + "updated_at": int(time.time()), } ) diff --git a/backend/open_webui/apps/webui/routers/files.py b/backend/open_webui/apps/webui/routers/files.py index f46a7992d..0a0e66c64 100644 --- a/backend/open_webui/apps/webui/routers/files.py +++ b/backend/open_webui/apps/webui/routers/files.py @@ -176,7 +176,7 @@ async def get_file_text_content_by_id(id: str, user=Depends(get_verified_user)): file = Files.get_file_by_id(id) if file and (file.user_id == user.id or user.role == "admin"): - return {"text": file.meta.get("content", {}).get("text", None)} + return {"text": file.data.get("content")} else: raise HTTPException( status_code=status.HTTP_404_NOT_FOUND,