nopaque/app/jobs/background_functions.py

10 lines
230 B
Python
Raw Normal View History

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