File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
apps/knowledge/serializers Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -587,18 +587,18 @@ class Split(serializers.Serializer):
587587 workspace_id = serializers .CharField (required = True , label = _ ('workspace id' ))
588588 knowledge_id = serializers .UUIDField (required = True , label = _ ('knowledge id' ))
589589
590- def is_valid (self , * , raise_exception = True ):
590+ def is_valid (self , * , instance = None , raise_exception = True ):
591591 super ().is_valid (raise_exception = True )
592- files = self . data .get ('file' )
592+ files = instance .get ('file' )
593593 for f in files :
594594 if f .size > 1024 * 1024 * 100 :
595595 raise AppApiException (500 , _ (
596596 'The maximum size of the uploaded file cannot exceed {}MB'
597597 ).format (100 ))
598598
599599 def parse (self , instance ):
600- self .is_valid (raise_exception = True )
601- DocumentSplitRequest (instance ).is_valid (raise_exception = True )
600+ self .is_valid (instance = instance , raise_exception = True )
601+ DocumentSplitRequest (data = instance ).is_valid (raise_exception = True )
602602
603603 file_list = instance .get ("file" )
604604 return reduce (
You can’t perform that action at this time.
0 commit comments