From 2b0b87c0f9849514b713c50b45855a0893ebb911 Mon Sep 17 00:00:00 2001 From: kaiwdev Date: Mon, 20 Oct 2025 14:19:02 +0900 Subject: [PATCH] fix: handle invalid order_by attribute in Chat --- 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 3644c53e14..3ae7112f3e 100644 --- a/backend/open_webui/models/chats.py +++ b/backend/open_webui/models/chats.py @@ -441,7 +441,7 @@ class ChatTable: direction = filter.get("direction") if order_by and direction: - if not getattr(Chat, order_by): + if not getattr(Chat, order_by, None): raise ValueError("Invalid order_by field") if direction.lower() == "asc":