From b1048fc9bcc55ced07a431fa4a14e8b1f7e4a170 Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Sat, 7 Mar 2026 20:22:01 -0600 Subject: [PATCH] refac --- backend/open_webui/models/chats.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/backend/open_webui/models/chats.py b/backend/open_webui/models/chats.py index 9b8261b8d4..78aa4d3ded 100644 --- a/backend/open_webui/models/chats.py +++ b/backend/open_webui/models/chats.py @@ -1039,9 +1039,13 @@ class ChatTable: if order_by and direction: if hasattr(Chat, order_by): if direction.lower() == "asc": - query = query.order_by(getattr(Chat, order_by).asc(), Chat.id) + query = query.order_by( + getattr(Chat, order_by).asc(), Chat.id + ) elif direction.lower() == "desc": - query = query.order_by(getattr(Chat, order_by).desc(), Chat.id) + query = query.order_by( + getattr(Chat, order_by).desc(), Chat.id + ) else: query = query.order_by(Chat.updated_at.desc(), Chat.id)