mirror of
https://github.com/1Panel-dev/MaxKB.git
synced 2025-12-26 01:33:05 +00:00
chore: update file query to include document_id in filter
--bug=1062912 --user=刘瑞斌 【知识库】文档-替换原文档成功,但是下载原文档依然是替换前的文档 https://www.tapd.cn/62980211/s/1789094
This commit is contained in:
parent
1070d27d2a
commit
a584378002
|
|
@ -1548,7 +1548,8 @@ class DocumentSerializers(serializers.Serializer):
|
|||
|
||||
# 查找所有具有相同sha256_hash的文件
|
||||
files_to_update = QuerySet(File).filter(
|
||||
Q(sha256_hash=original_hash) & Q(source_id=self.data.get('knowledge_id'))
|
||||
sha256_hash=original_hash,
|
||||
source_id__in=[self.data.get('knowledge_id'), self.data.get('document_id')]
|
||||
)
|
||||
|
||||
# 更新所有相同hash的文件
|
||||
|
|
|
|||
Loading…
Reference in New Issue