Skip to content

Commit

Permalink
Merge pull request TandoorRecipes#1280 from MarcusWolschon/feature127…
Browse files Browse the repository at this point in the history
…5_readable_export_file_names

TandoorRecipes#1275
  • Loading branch information
vabene1111 committed Jan 12, 2022
2 parents 93b868b + 80de87d commit c4f40b9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cookbook/integration/default.py
Expand Up @@ -2,6 +2,7 @@
from io import BytesIO, StringIO
from re import match
from zipfile import ZipFile
from django.utils.text import get_valid_filename

from rest_framework.renderers import JSONRenderer

Expand Down Expand Up @@ -56,7 +57,8 @@ def get_files_from_recipes(self, recipes, cookie):
pass

recipe_zip_obj.close()
export_zip_obj.writestr(str(r.pk) + '.zip', recipe_zip_stream.getvalue())

export_zip_obj.writestr(get_valid_filename(r.name) + '.zip', recipe_zip_stream.getvalue())
export_zip_obj.close()

return [[ 'export.zip', export_zip_stream.getvalue() ]]

0 comments on commit c4f40b9

Please sign in to comment.