Skip to content

Commit a584378

Browse files
committed
chore: update file query to include document_id in filter
--bug=1062912 --user=刘瑞斌 【知识库】文档-替换原文档成功,但是下载原文档依然是替换前的文档 https://www.tapd.cn/62980211/s/1789094
1 parent 1070d27 commit a584378

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

apps/knowledge/serializers/document.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1548,7 +1548,8 @@ def replace(self):
15481548

15491549
# 查找所有具有相同sha256_hash的文件
15501550
files_to_update = QuerySet(File).filter(
1551-
Q(sha256_hash=original_hash) & Q(source_id=self.data.get('knowledge_id'))
1551+
sha256_hash=original_hash,
1552+
source_id__in=[self.data.get('knowledge_id'), self.data.get('document_id')]
15521553
)
15531554

15541555
# 更新所有相同hash的文件

0 commit comments

Comments
 (0)