Merge pull request #693 from taigaio/Allowing-export-project-even-if-any-file-doesnt-exist

Allowing export projects even if any attachment doesn't exist in the …
remotes/origin/issue/4795/notification_even_they_are_disabled
David Barragán Merino 2016-04-08 12:22:36 +02:00
commit dd4fc1b351
1 changed files with 8 additions and 7 deletions

View File

@ -111,6 +111,7 @@ def render_project(project, outfile, chunk_size = 8190):
# We write the attached_files by chunks so the memory used is not increased
attachment_file = attachment.attached_file
if default_storage.exists(attachment_file.name):
with default_storage.open(attachment_file.name) as f:
while True:
bin_data = f.read(chunk_size)