We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4b9b23b commit 661af6cCopy full SHA for 661af6c
1 file changed
backend/open_webui/models/chats.py
@@ -1461,8 +1461,8 @@ def move_chats_by_user_id_and_folder_id(
1461
def delete_shared_chats_by_user_id(self, user_id: str, db: Optional[Session] = None) -> bool:
1462
try:
1463
with get_db_context(db) as db:
1464
- chats_by_user = db.query(Chat).filter_by(user_id=user_id).all()
1465
- 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]
1466
1467
# Use subquery to delete chat_messages for shared chats
1468
shared_id_subq = db.query(Chat.id).filter(Chat.user_id.in_(shared_chat_ids)).subquery()
0 commit comments