Vinay Jose commited on
Commit
787ef79
1 Parent(s): 0ce7520

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -63,12 +63,12 @@ def contacts_edit_post(contact_id=0):
63
  else:
64
  render_template("edit.html", contact=c)
65
 
66
- @app.post("/contacts/<contact_id>/delete")
67
  def contacts_delete(contact_id=0):
68
  contact = Contact.find(contact_id)
69
  contact.delete()
70
  flash("Deleted Contact!")
71
- return redirect("/contacts")
72
 
73
  if __name__ == "__main__":
74
  app.run(host="0.0.0.0", port="7860", debug=True)
 
63
  else:
64
  render_template("edit.html", contact=c)
65
 
66
+ @app.delete("/contacts/<contact_id>")
67
  def contacts_delete(contact_id=0):
68
  contact = Contact.find(contact_id)
69
  contact.delete()
70
  flash("Deleted Contact!")
71
+ return redirect("/contacts", 303)
72
 
73
  if __name__ == "__main__":
74
  app.run(host="0.0.0.0", port="7860", debug=True)