Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
TandoorRecipes#1275 readable receipt file names in default export
  • Loading branch information
MarcusWolschon committed Jan 11, 2022
1 parent 93b868b commit 80de87d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cookbook/integration/default.py
Original file line number Diff line number Diff line change
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 80de87d

Please sign in to comment.