Fix crash on delete (3)
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
3a38f7ed6d
commit
1b6ad2fecb
@ -122,9 +122,9 @@ def admin():
|
|||||||
if form.validate_on_submit():
|
if form.validate_on_submit():
|
||||||
link = AnimeLink.query.filter_by(id=form.id.data).first()
|
link = AnimeLink.query.filter_by(id=form.id.data).first()
|
||||||
if link:
|
if link:
|
||||||
|
form.message = '%s (%s) has been successfully deleted' % (link.title.name, link.season)
|
||||||
db.session.delete(link)
|
db.session.delete(link)
|
||||||
db.session.commit()
|
db.session.commit()
|
||||||
form.message = '%s (%s) has been successfully deleted' % (link.title.name, link.season)
|
|
||||||
remove_garbage(link)
|
remove_garbage(link)
|
||||||
else:
|
else:
|
||||||
form._errors = {'id': ['Id %s was not found in the database' % form.id.data]}
|
form._errors = {'id': ['Id %s was not found in the database' % form.id.data]}
|
||||||
|
Reference in New Issue
Block a user