nopaque/app/jobs/background_functions.py

10 lines
230 B
Python
Raw Normal View History

2020-03-27 11:06:11 +00:00
from ..models import Job
2019-11-14 12:40:05 +00:00
def delete_job_(app, job_id):
with app.app_context():
2019-11-15 12:09:12 +00:00
job = Job.query.get(job_id)
2019-11-14 12:40:05 +00:00
if job is None:
raise Exception('Job {} not found!'.format(job_id))
job.delete()