Example #1
0
def shopping_delete(id): 
  session = request.environ["beaker.session"]
  shopping = Shopping_List(id)
  if shopping.shopping["user_id"] != session["user"]:
    if not "flash" in session:
      session["flash"] = {} 
    session["flash"]["error"]="You do not have permission to access that resource"
    redirect("/")
  else:
    if not "flash" in session:
      session["flash"] = {} 
    session["flash"]["success"]="Shopping List deleted successfully"
    shopping.delete()
    redirect("/shopping")