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)
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"))
def delete_alert(alert_id): alert = Alert.find_by_id(alert_id) alert.remove_from_mongo() return redirect(url_for(".index"))