mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-12 12:25:20 +00:00
fix: handle invalid order_by attribute in Chat
This commit is contained in:
parent
43eac35b5b
commit
2b0b87c0f9
1 changed files with 1 additions and 1 deletions
|
|
@ -441,7 +441,7 @@ class ChatTable:
|
||||||
direction = filter.get("direction")
|
direction = filter.get("direction")
|
||||||
|
|
||||||
if order_by and 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")
|
raise ValueError("Invalid order_by field")
|
||||||
|
|
||||||
if direction.lower() == "asc":
|
if direction.lower() == "asc":
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue