fix comparison with callable (#23978)
This commit is contained in:
@@ -103,9 +103,9 @@ class ConversationService:
|
|||||||
@classmethod
|
@classmethod
|
||||||
def _build_filter_condition(cls, sort_field: str, sort_direction: Callable, reference_conversation: Conversation):
|
def _build_filter_condition(cls, sort_field: str, sort_direction: Callable, reference_conversation: Conversation):
|
||||||
field_value = getattr(reference_conversation, sort_field)
|
field_value = getattr(reference_conversation, sort_field)
|
||||||
if sort_direction == desc:
|
if sort_direction is desc:
|
||||||
return getattr(Conversation, sort_field) < field_value
|
return getattr(Conversation, sort_field) < field_value
|
||||||
else:
|
|
||||||
return getattr(Conversation, sort_field) > field_value
|
return getattr(Conversation, sort_field) > field_value
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
@@ -147,7 +147,7 @@ class ConversationService:
|
|||||||
app_model.tenant_id, message.query, conversation.id, app_model.id
|
app_model.tenant_id, message.query, conversation.id, app_model.id
|
||||||
)
|
)
|
||||||
conversation.name = name
|
conversation.name = name
|
||||||
except:
|
except Exception:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
db.session.commit()
|
db.session.commit()
|
||||||
|
Reference in New Issue
Block a user