nopaque/app/jobs/background_functions.py
2019-11-15 13:09:12 +01:00

10 lines
232 B
Python

from app.models import Job
def delete_job_(app, job_id):
with app.app_context():
job = Job.query.get(job_id)
if job is None:
raise Exception('Job {} not found!'.format(job_id))
job.delete()