fix: enhance meta validation to check for empty dictionary
--bug=1058076 --user=刘瑞斌 【知识库】飞书知识库-文档列表操作列-设置命中处理方式为“直接回答” 报异常 https://www.tapd.cn/62980211/s/1724448
This commit is contained in:
parent
880697bf35
commit
67f719747c
@ -131,7 +131,7 @@ class DocumentEditInstanceSerializer(serializers.Serializer):
|
||||
|
||||
def is_valid(self, *, document: Document = None):
|
||||
super().is_valid(raise_exception=True)
|
||||
if 'meta' in self.data and self.data.get('meta') is not None:
|
||||
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)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user