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))
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)
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"))
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"))
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"))
def edit_hook(): params = flat_multi(request.values) order.update_order(params) return redirect(url_for("orders.list_hook"))
def edit_get_hook(): params = flat_multi(request.values) return order.get_order(params['order_id'])
def wrapper(*args, **kwds): params = flat_multi(request.values) return f(params)