Beispiel #1
0
def login():
    params = flat_multi(request.form)
    try:
        auth.login(params)
        return logged_in()
    except WebException as errorz:
        return render_template('login.html', error=_get_message(errorz))
Beispiel #2
0
def new_add_hook():
    params = flat_multi(request.form)
    try:
        order.new(params)
        return redirect(url_for("orders.list_hook"))
    except WebException as error:
        data = order.list_products()
        return render_template('neworder.html',
                               error=_get_message(error),
                               data=data,
                               params=params)
Beispiel #3
0
def test_done_hook():
    params = flat_multi(request.values)
    order.change_state(params['order_id'], models.states["test_done"])
    return redirect(url_for("orders.list_hook"))
Beispiel #4
0
def confirm_payment_hook():
    params = flat_multi(request.values)
    order.change_state(params['order_id'], models.states["confirm_pay"])
    return redirect(url_for("orders.list_hook"))
Beispiel #5
0
def set_cost_hook():
    params = flat_multi(request.values)
    order.set_cost(params['order_id'], params['cost'])
    order.change_state(params['order_id'], models.states["cost_set"])
    return redirect(url_for("orders.list_hook"))
Beispiel #6
0
def edit_hook():
    params = flat_multi(request.values)
    order.update_order(params)
    return redirect(url_for("orders.list_hook"))
Beispiel #7
0
def edit_get_hook():
    params = flat_multi(request.values)
    return order.get_order(params['order_id'])
Beispiel #8
0
 def wrapper(*args, **kwds):
     params = flat_multi(request.values)
     return f(params)