orm filter -> where (#22801)
Signed-off-by: -LAN- <laipz8200@outlook.com> Co-authored-by: -LAN- <laipz8200@outlook.com> Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -25,7 +25,7 @@ class AgentService:
|
||||
|
||||
conversation: Conversation | None = (
|
||||
db.session.query(Conversation)
|
||||
.filter(
|
||||
.where(
|
||||
Conversation.id == conversation_id,
|
||||
Conversation.app_id == app_model.id,
|
||||
)
|
||||
@@ -37,7 +37,7 @@ class AgentService:
|
||||
|
||||
message: Optional[Message] = (
|
||||
db.session.query(Message)
|
||||
.filter(
|
||||
.where(
|
||||
Message.id == message_id,
|
||||
Message.conversation_id == conversation_id,
|
||||
)
|
||||
@@ -52,12 +52,10 @@ class AgentService:
|
||||
if conversation.from_end_user_id:
|
||||
# only select name field
|
||||
executor = (
|
||||
db.session.query(EndUser, EndUser.name).filter(EndUser.id == conversation.from_end_user_id).first()
|
||||
db.session.query(EndUser, EndUser.name).where(EndUser.id == conversation.from_end_user_id).first()
|
||||
)
|
||||
else:
|
||||
executor = (
|
||||
db.session.query(Account, Account.name).filter(Account.id == conversation.from_account_id).first()
|
||||
)
|
||||
executor = db.session.query(Account, Account.name).where(Account.id == conversation.from_account_id).first()
|
||||
|
||||
if executor:
|
||||
executor = executor.name
|
||||
|
||||
Reference in New Issue
Block a user