File tree Expand file tree Collapse file tree
apps/knowledge/serializers Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -186,14 +186,14 @@ def write_image(zip_path: str, image_list: List[str]):
186186 if search :
187187 text = search .group ()
188188 if text .startswith ('(./oss/file/' ):
189- r = text .replace ('(./oss/file/' , '' ).replace (')' , '' )
190- r = r .strip ().split (" " )[0 ]
191- if not is_valid_uuid (r ):
192- break
193- file = QuerySet (File ).filter (id = r ).first ()
189+ image_id = text .replace ('(./oss/file/' , '' ).replace (')' , '' )
190+ image_id = image_id .strip ().split (" " )[0 ]
191+ if not is_valid_uuid (image_id ):
192+ continue
193+ file = QuerySet (File ).filter (id = image_id ).first ()
194194 if file is None :
195- break
196- zip_inner_path = os .path .join ('oss' , 'file' , r )
195+ continue
196+ zip_inner_path = os .path .join ('oss' , 'file' , image_id )
197197 file_path = os .path .join (zip_path , zip_inner_path )
198198 if not os .path .exists (os .path .dirname (file_path )):
199199 os .makedirs (os .path .dirname (file_path ))
You can’t perform that action at this time.
0 commit comments