From 0185f3340d2778f3b75a8036b0e81a0aec78037f Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Sun, 22 Feb 2026 17:28:01 -0600 Subject: [PATCH] refac --- backend/open_webui/models/chats.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/open_webui/models/chats.py b/backend/open_webui/models/chats.py index 5025cf7fca..7b490102b7 100644 --- a/backend/open_webui/models/chats.py +++ b/backend/open_webui/models/chats.py @@ -631,7 +631,7 @@ class ChatTable: with get_db_context(db) as db: # Use subquery to delete chat_messages for shared chats shared_chat_id_subquery = ( - db.query(Chat.id).filter_by(user_id=f"shared-{chat_id}").subquery() + db.query(Chat.id).filter_by(user_id=f"shared-{chat_id}").scalar_subquery() ) db.query(ChatMessage).filter( ChatMessage.chat_id.in_(shared_chat_id_subquery)