diff --git a/cookbook/integration/default.py b/cookbook/integration/default.py index 91d5b22cf..39c0bc666 100644 --- a/cookbook/integration/default.py +++ b/cookbook/integration/default.py @@ -37,8 +37,9 @@ class Default(Integration): return 'recipe.json', JSONRenderer().render(export).decode("utf-8") def get_files_from_recipes(self, recipes, cookie): + export_zip_stream = BytesIO() + export_zip_obj = ZipFile(export_zip_stream, 'w') - files = [] for r in recipes: if r.internal and r.space == self.request.space: recipe_zip_stream = BytesIO() @@ -55,7 +56,7 @@ class Default(Integration): pass recipe_zip_obj.close() + export_zip_obj.writestr(str(r.pk) + '.zip', recipe_zip_stream.getvalue()) + export_zip_obj.close() - files.append([ str(r.pk) + '.zip', recipe_zip_stream.getvalue() ]) - - return files \ No newline at end of file + return [[ 'export.zip', export_zip_stream.getvalue() ]] \ No newline at end of file