nopaque/app/jobs/background_functions.py

10 lines
249 B
Python
Raw Normal View History

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