Fix some ideas from import testing (#2093)

* Add some local changes that didn't make it into the previous PR
* Works on #2087
This commit is contained in:
Kevin Chung
2022-04-20 05:13:48 -04:00
committed by GitHub
parent fce5ee418b
commit f01e2d9a40

View File

@@ -437,9 +437,18 @@ def import_ctf(backup, erase=True):
def background_import_ctf(backup): def background_import_ctf(backup):
# Empty out import status trackers
cache.set("import_start_time", value=None)
cache.set("import_end_time", value=None)
cache.set("import_status", value=None)
cache.set("import_error", value=None)
# The manage.py script will delete the backup for us # The manage.py script will delete the backup for us
f = tempfile.NamedTemporaryFile(delete=False) f = tempfile.NamedTemporaryFile(delete=False)
# Store the backup file in our tempfile
backup.save(f.name) backup.save(f.name)
python = sys.executable # Get path of Python interpreter python = sys.executable # Get path of Python interpreter
manage_py = Path(app.root_path).parent / "manage.py" # Path to manage.py manage_py = Path(app.root_path).parent / "manage.py" # Path to manage.py
subprocess.Popen( # nosec B603 subprocess.Popen( # nosec B603