Make Jobs restartable when they are "complete"

This commit is contained in:
Patrick Jentsch
2021-05-03 11:12:40 +02:00
parent f4233093c0
commit f2a5fe3143
2 changed files with 5 additions and 5 deletions

View File

@ -47,8 +47,8 @@ def download_job_input(job_id, job_input_id):
@admin_required
def restart(job_id):
job = Job.query.get_or_404(job_id)
if job.status != 'failed':
flash('Can not restart job "{}": Status is not "failed"'.format(job.title), 'error') # noqa
if job.status not in ['complete', 'failed']:
flash('Can not restart job "{}": Status is not "complete/failed"'.format(job.title), 'error') # noqa
else:
tasks.restart_job(job_id)
flash('Job "{}" has been marked to get restarted!'.format(job.title), 'job') # noqa