Fix history import by file on multi-handler setups

The uploaded archive was going to be deleted before the job started running.
This commit is contained in:
mvdbeek
2018-01-19 12:15:16 +01:00
parent b82676b8ee
commit b5d0030b3e
@@ -1155,6 +1155,9 @@ class HistoryController(BaseUIController, SharableMixin, UsesAnnotations, UsesIt
archive_url = kwargs.get('archive_url', None)
archive_source = None
if hasattr(archive_file, 'file'):
# archive_file.file is a TemporaryFile and will be deleted once it is closed.
# We prevent this by setting `delete` to `False`.
archive_file.file.delete = False
archive_source = archive_file.file.name
archive_type = 'file'
elif archive_url: