Change delete execution

This commit is contained in:
Patrick Jentsch
2019-11-14 09:48:30 +01:00
parent 1152417419
commit bab479db20
9 changed files with 111 additions and 148 deletions

View File

@ -1,5 +1,5 @@
from app.models import Job, JobInput, JobResult
from app.utils import background_delete_job
from app.background_functions import delete_job_
from flask import (abort, current_app, flash, redirect, render_template,
send_from_directory, url_for)
from flask_login import current_user, login_required
@ -23,7 +23,7 @@ def delete_job(job_id):
job = Job.query.get_or_404(job_id)
if not (job.creator == current_user or current_user.is_administrator()):
abort(403)
delete_thread = threading.Thread(target=background_delete_job,
delete_thread = threading.Thread(target=delete_job_,
args=(current_app._get_current_object(),
job_id))
delete_thread.start()