U - 任务管理 禁止未设置触发器的任务启动

pull/15/head
雷二猛 2019-07-17 11:09:33 +08:00
parent d0ca9d23f6
commit 976374b5c5
1 changed files with 2 additions and 0 deletions

View File

@ -91,6 +91,8 @@ def set_trigger(job_id):
def switch(job_id):
job = Job.query.get_or_404(job_id)
if request.method == 'POST':
if job.trigger is None:
return json_response(message='请在 更多-设置触发器 中配置调度策略')
job.update(enabled=True)
scheduler.add_job(job)
elif request.method == 'DELETE':