Change delete execution

This commit is contained in:
Patrick Jentsch
2019-11-14 09:48:30 +01:00
parent 1152417419
commit bab479db20
9 changed files with 111 additions and 148 deletions

View File

@ -46,9 +46,8 @@ def service(service):
try:
os.makedirs(absolut_dir)
except OSError:
flash('[OSError] Could not add job!')
db.session.delete(job)
db.session.commit()
flash('[ERROR]: Could not add job!')
job.delete()
else:
for file in add_job_form.files.data:
filename = secure_filename(file.filename)