From 1b6ad2fecb762c5cc914334548e4ad72f1a6326d Mon Sep 17 00:00:00 2001 From: Michel Roux Date: Fri, 2 Oct 2020 14:15:13 +0200 Subject: [PATCH] Fix crash on delete (3) --- pynyaata/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pynyaata/__init__.py b/pynyaata/__init__.py index 92e27f7..0e89f7b 100644 --- a/pynyaata/__init__.py +++ b/pynyaata/__init__.py @@ -122,9 +122,9 @@ def admin(): if form.validate_on_submit(): link = AnimeLink.query.filter_by(id=form.id.data).first() if link: + form.message = '%s (%s) has been successfully deleted' % (link.title.name, link.season) db.session.delete(link) db.session.commit() - form.message = '%s (%s) has been successfully deleted' % (link.title.name, link.season) remove_garbage(link) else: form._errors = {'id': ['Id %s was not found in the database' % form.id.data]}