示例#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"))