We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 30e9598 commit 2a74011Copy full SHA for 2a74011
1 file changed
backend/open_webui/models/chats.py
@@ -1470,8 +1470,8 @@ def move_chats_by_user_id_and_folder_id(
1470
def delete_shared_chats_by_user_id(self, user_id: str, db: Optional[Session] = None) -> bool:
1471
try:
1472
with get_db_context(db) as db:
1473
- chats_by_user = db.query(Chat).filter_by(user_id=user_id).all()
1474
- shared_chat_ids = [f'shared-{chat.id}' for chat in chats_by_user]
+ id_rows = db.query(Chat.id).filter_by(user_id=user_id).all()
+ shared_chat_ids = [f'shared-{row[0]}' for row in id_rows]
1475
1476
# Use subquery to delete chat_messages for shared chats
1477
shared_id_subq = db.query(Chat.id).filter(Chat.user_id.in_(shared_chat_ids)).subquery()
0 commit comments