mirror of
https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
synced 2025-06-12 00:50:40 +00:00
Updated URL Logic for admin package
This commit is contained in:
@ -2,10 +2,10 @@ from app.models import Job, JobInput, JobResult
|
||||
from flask import (abort, current_app, flash, redirect, render_template,
|
||||
send_from_directory, url_for)
|
||||
from flask_login import current_user, login_required
|
||||
from threading import Thread
|
||||
from . import jobs
|
||||
from .background_functions import delete_job_
|
||||
import os
|
||||
import threading
|
||||
|
||||
|
||||
@jobs.route('/<int:job_id>')
|
||||
@ -23,10 +23,9 @@ 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=delete_job_,
|
||||
args=(current_app._get_current_object(),
|
||||
job_id))
|
||||
delete_thread.start()
|
||||
thread = Thread(target=delete_job_,
|
||||
args=(current_app._get_current_object(), job_id))
|
||||
thread.start()
|
||||
flash('Job has been deleted!')
|
||||
return redirect(url_for('main.dashboard'))
|
||||
|
||||
|
Reference in New Issue
Block a user