mirror of
https://github.com/1Panel-dev/MaxKB.git
synced 2025-12-26 01:33:05 +00:00
fix: ensure valid class is checked before validation in document processing
This commit is contained in:
parent
570c891ad2
commit
50e93e490a
|
|
@ -134,7 +134,8 @@ class DocumentEditInstanceSerializer(serializers.Serializer):
|
|||
if 'meta' in self.data and self.data.get('meta') is not None and self.data.get('meta') != {}:
|
||||
knowledge_meta_valid_map = self.get_meta_valid_map()
|
||||
valid_class = knowledge_meta_valid_map.get(document.type)
|
||||
valid_class(data=self.data.get('meta')).is_valid(raise_exception=True)
|
||||
if valid_class is not None:
|
||||
valid_class(data=self.data.get('meta')).is_valid(raise_exception=True)
|
||||
|
||||
|
||||
class DocumentSplitRequest(serializers.Serializer):
|
||||
|
|
|
|||
|
|
@ -178,6 +178,7 @@ const open = (row: any, list: Array<string>) => {
|
|||
hit_handling_method: row.hit_handling_method,
|
||||
directly_return_similarity: row.directly_return_similarity,
|
||||
...row.meta,
|
||||
meta: row.meta,
|
||||
}
|
||||
isImport.value = false
|
||||
} else if (list) {
|
||||
|
|
@ -212,9 +213,13 @@ const submit = async (formEl: FormInstance | undefined) => {
|
|||
const obj = {
|
||||
hit_handling_method: form.value.hit_handling_method,
|
||||
directly_return_similarity: form.value.directly_return_similarity,
|
||||
// 飞书文档需要传递meta信息,不能被页面上的form覆盖
|
||||
meta: {
|
||||
source_url: form.value.source_url,
|
||||
selector: form.value.selector,
|
||||
...form.value.meta,
|
||||
...{
|
||||
source_url: form.value.source_url,
|
||||
selector: form.value.selector,
|
||||
}
|
||||
},
|
||||
}
|
||||
loadSharedApi({ type: 'document', systemType: apiType.value })
|
||||
|
|
|
|||
Loading…
Reference in New Issue