mirror of https://github.com/langgenius/dify.git
fix comparison with callable (#23978)
This commit is contained in:
parent
352776ba77
commit
821fe26b56
|
|
@ -103,9 +103,9 @@ class ConversationService:
|
|||
@classmethod
|
||||
def _build_filter_condition(cls, sort_field: str, sort_direction: Callable, reference_conversation: Conversation):
|
||||
field_value = getattr(reference_conversation, sort_field)
|
||||
if sort_direction == desc:
|
||||
if sort_direction is desc:
|
||||
return getattr(Conversation, sort_field) < field_value
|
||||
else:
|
||||
|
||||
return getattr(Conversation, sort_field) > field_value
|
||||
|
||||
@classmethod
|
||||
|
|
@ -147,7 +147,7 @@ class ConversationService:
|
|||
app_model.tenant_id, message.query, conversation.id, app_model.id
|
||||
)
|
||||
conversation.name = name
|
||||
except:
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
db.session.commit()
|
||||
|
|
|
|||
Loading…
Reference in New Issue