From f8d31dd3254b672ab950c52e1d81978128c291df Mon Sep 17 00:00:00 2001 From: Damien De Paoli Date: Sat, 14 Nov 2020 14:24:35 +1100 Subject: [PATCH] make sure alert is set to success/something, even if we are just getting an author - it was unset in this scenario --- main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.py b/main.py index a7d0a63..72db533 100644 --- a/main.py +++ b/main.py @@ -166,6 +166,7 @@ def authors(): @app.route("/author/", methods=["GET", "POST"]) def author(id): ### DDP: should this be request.form or request.values? + alert="Success" author_form = AuthorForm(request.form) if request.method == 'POST' and author_form.validate(): id = request.form['id'] @@ -181,7 +182,6 @@ def author(id): author.surname = request.form['surname'] db.session.commit() message="Successfully Updated Author (id={})".format(id) - alert="Success" else: author = Author.query.get(id) author_form = AuthorForm(request.values, obj=author)