Beispiel #1
0
def edit_alert(alert_id):
    if request.method == 'POST':
        price_limit = float(request.form['price_limit'])

        alert = Alert.get_by_id(alert_id)
        alert.price_limit = price_limit
        alert.load_item_price()  # This already saves to MongoDB

    # What happens if it's a GET request
    return render_template(
        "alerts/edit_alert.html", alert=Alert.get_by_id(
            alert_id))  # Send the user an error if their login was invalid
Beispiel #2
0
def check_alert_price(alert_id):
    Alert.get_by_id(alert_id).load_item_price()
    return redirect(url_for('.get_alert_page', alert_id=alert_id))
Beispiel #3
0
def get_alert_page(alert_id):
    return render_template('alerts/alert.html',
                           alert=Alert.get_by_id(alert_id))
Beispiel #4
0
def delete_alert(alert_id):
    Alert.get_by_id(alert_id).remove_from_mongo()
    return redirect(url_for('users.user_alerts'))
Beispiel #5
0
def activate_alert(alert_id):
    Alert.get_by_id(alert_id).activate()
    return redirect(url_for('users.user_alerts'))