Merge pull request #18452 from kaiwinut/fix/chat-getattr-error

fix: Handle invalid order_by attribute in Chat
This commit is contained in:
Tim Baek 2025-10-20 14:00:21 -04:00 committed by GitHub
commit e24fec0de4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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":