mirror of
https://github.com/open-webui/open-webui.git
synced 2026-08-25 15:04:49 -06:00
Merge pull request #18452 from kaiwinut/fix/chat-getattr-error
fix: Handle invalid order_by attribute in Chat
This commit is contained in:
@@ -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":
|
||||
|
||||
Reference in New Issue
Block a user