make sure alert is set to success/something, even if we are just getting an author - it was unset in this scenario
This commit is contained in:
2
main.py
2
main.py
@@ -166,6 +166,7 @@ def authors():
|
||||
@app.route("/author/<id>", 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)
|
||||
|
||||
Reference in New Issue
Block a user