Merge pull request #207 from edufresne/master
Truncate zip file before re-writing it for replace_media with file-like objects
This commit is contained in:
commit
e3bf22376a
@ -463,6 +463,8 @@ class DocxTemplate(object):
|
||||
DocxTemplate(docx_file).save(tmp_file)
|
||||
tmp_file.seek(0)
|
||||
docx_file.seek(0)
|
||||
docx_file.truncate()
|
||||
docx_file.seek(0)
|
||||
|
||||
else:
|
||||
tmp_file = '%s_docxtpl_before_replace_medias' % docx_file
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user