File tree Expand file tree Collapse file tree 1 file changed +2
-1
lines changed
apps/knowledge/serializers Expand file tree Collapse file tree 1 file changed +2
-1
lines changed Original file line number Diff line number Diff line change @@ -453,6 +453,7 @@ def export_excel(self, with_valid=True):
453453 def export_zip (self , with_valid = True ):
454454 if with_valid :
455455 self .is_valid (raise_exception = True )
456+ knowledge = QuerySet (Knowledge ).filter (id = self .data .get ("knowledge_id" )).first ()
456457 document_list = QuerySet (Document ).filter (knowledge_id = self .data .get ('knowledge_id' ))
457458 paragraph_list = native_search (
458459 QuerySet (Paragraph ).filter (knowledge_id = self .data .get ("knowledge_id" )),
@@ -472,7 +473,7 @@ def export_zip(self, with_valid=True):
472473
473474 workbook = DocumentSerializers .Operate .get_workbook (data_dict , document_dict )
474475 response = HttpResponse (content_type = 'application/zip' )
475- response ['Content-Disposition' ] = 'attachment; filename="archive .zip"'
476+ response ['Content-Disposition' ] = f 'attachment; filename="{ knowledge . name } .zip"'
476477 zip_buffer = io .BytesIO ()
477478 with TemporaryDirectory () as tempdir :
478479 knowledge_file = os .path .join (tempdir , 'knowledge.xlsx' )
You can’t perform that action at this time.
0 commit comments