def edit_alert(alert_id): alert = Alert.get_obj_from_db_by_id(alert_id) if request.method == 'POST': alert.price_limit = request.form['price_limit'] alert.update_to_db() return redirect(url_for('users.user_alerts')) # return render_template(base_model + '/' + 'alert.html', alert=alert) else: # it's a GET not a POST return render_template(base_model + '/' + 'edit_alert.html', alert=alert)
def show_alert(alert_id): alert = Alert.get_obj_from_db_by_id(alert_id) return render_template(base_model + '/' + 'alert.html', alert=alert)
def update_alert(alert_id): alert = Alert.get_obj_from_db_by_id(alert_id) alert.load_item_price() return redirect(url_for('.show_alert', alert_id=alert_id))
def activate_alert(alert_id): alert = Alert.get_obj_from_db_by_id(alert_id) alert.activate() return redirect(url_for('users.user_alerts'))