Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions examples/tutorial/flaskr/blog.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ def create():
(title, body, g.user["id"]),
)
db.commit()
flash("Post created successfully!", "success")
return redirect(url_for("blog.index"))

return render_template("blog/create.html")
Expand Down Expand Up @@ -105,6 +106,7 @@ def update(id):
"UPDATE post SET title = ?, body = ? WHERE id = ?", (title, body, id)
)
db.commit()
flash("Post updated successfully!", "success")
return redirect(url_for("blog.index"))

return render_template("blog/update.html", post=post)
Expand All @@ -122,4 +124,5 @@ def delete(id):
db = get_db()
db.execute("DELETE FROM post WHERE id = ?", (id,))
db.commit()
flash("Post deleted successfully!", "success")
return redirect(url_for("blog.index"))
2 changes: 2 additions & 0 deletions notes.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
My personal notes for the Flask project
This new line is only on my feature branch.
Loading