예제 #1
0
def edit_alert(alert_id):
    alert = Alert.find_by_id(alert_id)

    if request.method == "POST":
        price_limit = float(request.form["price_limit"])
        alert.price_limit = price_limit
        alert.save_to_mongo()

        return redirect(url_for(".index"))

    return render_template("alerts/edit_alert.html", alert=alert)
예제 #2
0
def delete_alert(alert_id):
    alert = Alert.find_by_id(alert_id)
    if alert.user_email == session["email"]:
        alert.remove_from_mongo()
    return redirect(url_for(".index"))
예제 #3
0
def delete_alert(alert_id):
    alert = Alert.find_by_id(alert_id)
    alert.remove_from_mongo()
    return redirect(url_for(".index"))