Skip to content

Commit 55148b4

Browse files
committed
refactor: Recently queried questions query restriction for the current login user
1 parent 4df0953 commit 55148b4

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

backend/apps/chat/curd/chat.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@ def list_recent_questions(session: SessionDep, current_user: CurrentUser, dataso
5252
.join(Chat, ChatRecord.chat_id == Chat.id) # 关联Chat表
5353
.filter(
5454
Chat.datasource == datasource_id, # 使用Chat表的datasource字段
55-
ChatRecord.question.isnot(None)
55+
ChatRecord.question.isnot(None),
56+
ChatRecord.create_by == current_user.id
5657
)
5758
.group_by(ChatRecord.question)
5859
.order_by(desc(func.max(ChatRecord.create_time)))

0 commit comments

Comments
 (0)