Rework notification system

This commit is contained in:
Patrick Jentsch
2020-04-27 15:22:20 +02:00
parent b30382e605
commit c67c033aec
6 changed files with 32 additions and 28 deletions

View File

@ -61,7 +61,7 @@ def service(service):
os.makedirs(absolut_dir)
except OSError:
job.delete()
flash('Internal Server Error')
flash('Internal Server Error', 'job')
return make_response({'redirect_url': url_for('services.service',
service=service)},
500)
@ -74,9 +74,8 @@ def service(service):
db.session.add(job_input)
job.status = 'submitted'
db.session.commit()
job_url = url_for('jobs.job', job_id=job.id)
flash('<i class="left material-icons">work</i>'
'[<a href="{}">{}</a>] added'.format(job_url, job.title))
url = url_for('jobs.job', job_id=job.id)
flash('[<a href="{}">{}</a>] added'.format(url, job.title), 'job')
return make_response(
{'redirect_url': url_for('jobs.job', job_id=job.id)}, 201)
return render_template('services/{}.html.j2'.format(service),