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 11:06:24 -05:00
committed by Martin Cech
parent 33bd54079b
commit dedb1d3f4c
@@ -321,6 +321,9 @@ class HistoriesController(BaseAPIController, ExportsHistoryMixin, ImportsHistory
if archive_source:
archive_type = payload.get("archive_type", "url")
elif 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 = payload["archive_file"].file.name
archive_type = "file"
else: