Esempio n. 1
0
def deleteShopList():

    """ It deletes the shopping list by name """

    name = request.args.get("lname")
    date_created = request.args.get("date")
    all_names = ''

    if 'User' in session:

        if name is not None:

            ShoppingList.deleteShoppingList(name, session['User'], date_created)

        else:
            
            ShoppingList.deleteShoppingListByDate(session['User'], date_created)

        
        all_names = ShoppingList.getShoppingListNames(session['User'])

        return redirect ('/getShoppingLists')

    else:

        flash = []
        flash = "You need to login"
        return render_template("/error.html",url="homepage.html")