mirror of
https://github.com/1Panel-dev/MaxKB.git
synced 2025-12-30 01:32:49 +00:00
fix: rename image_name to file_name in zip_split_handle and remove workspace_id assignment in document
This commit is contained in:
parent
bd71ca9eb4
commit
c3581be9bd
|
|
@ -147,7 +147,7 @@ class ZipSplitHandle(BaseSplitHandle):
|
|||
with zip_ref.open(image.get('source_file')) as f:
|
||||
i = File(
|
||||
id=image.get('image_id'),
|
||||
image_name=os.path.basename(image.get('source_file')),
|
||||
file_name=os.path.basename(image.get('source_file')),
|
||||
meta={'debug': False, 'content': f.read()} # 这里的content是二进制数据
|
||||
)
|
||||
image_mode_list.append(i)
|
||||
|
|
|
|||
|
|
@ -579,7 +579,6 @@ class DocumentSerializers(serializers.Serializer):
|
|||
# save image
|
||||
for file in save_image_list:
|
||||
file_bytes = file.meta.pop('content')
|
||||
file.workspace_id = self.data.get('workspace_id')
|
||||
file.meta['knowledge_id'] = self.data.get('knowledge_id')
|
||||
file.save(file_bytes)
|
||||
|
||||
|
|
@ -622,7 +621,6 @@ class DocumentSerializers(serializers.Serializer):
|
|||
# save image
|
||||
for file in save_image_list:
|
||||
file_bytes = file.meta.pop('content')
|
||||
file.workspace_id = self.data.get('workspace_id')
|
||||
file.meta['knowledge_id'] = self.data.get('knowledge_id')
|
||||
file.save(file_bytes)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue