From c02451178c15067100e47f74d1644c0270f65dab Mon Sep 17 00:00:00 2001 From: Classic298 <27028174+Classic298@users.noreply.github.com> Date: Tue, 30 Dec 2025 09:15:31 +0100 Subject: [PATCH] init (#20212) --- backend/open_webui/main.py | 2 +- backend/open_webui/routers/chats.py | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/backend/open_webui/main.py b/backend/open_webui/main.py index 97d91c0ee0..7e5a19498b 100644 --- a/backend/open_webui/main.py +++ b/backend/open_webui/main.py @@ -1647,7 +1647,7 @@ async def chat_completion( ) # Insert chat files from parent message if any - parent_message = metadata.get("parent_message", {}) + parent_message = metadata.get("parent_message") or {} parent_message_files = parent_message.get("files", []) if parent_message_files: try: diff --git a/backend/open_webui/routers/chats.py b/backend/open_webui/routers/chats.py index c98e119da5..ab558c5c81 100644 --- a/backend/open_webui/routers/chats.py +++ b/backend/open_webui/routers/chats.py @@ -682,10 +682,8 @@ async def get_user_pinned_chats( async def get_user_chats( user=Depends(get_verified_user), db: Session = Depends(get_session) ): - return [ - ChatResponse(**chat.model_dump()) - for chat in Chats.get_chats_by_user_id(user.id, db=db) - ] + result = Chats.get_chats_by_user_id(user.id, db=db) + return [ChatResponse(**chat.model_dump()) for chat in result.items] ############################