mirror of https://github.com/langgenius/dify.git
fix comparison with callable (#23978)
This commit is contained in:
parent
352776ba77
commit
821fe26b56
|
|
@ -103,10 +103,10 @@ 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
|
||||||
def rename(
|
def rename(
|
||||||
|
|
@ -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()
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue