commit
43a196248b
1 changed files with 3 additions and 1 deletions
|
@ -53,6 +53,8 @@ def order(id, form=None):
|
|||
@login_required
|
||||
def order_edit(id):
|
||||
order = Order.query.filter(Order.id == id).first()
|
||||
if current_user.id is not order.courrier_id and not current_user.is_admin():
|
||||
abort(401)
|
||||
if order is None:
|
||||
abort(404)
|
||||
orderForm = OrderForm(obj=order)
|
||||
|
@ -63,6 +65,7 @@ def order_edit(id):
|
|||
return redirect(url_for('.order', id=order.id))
|
||||
return render_template('order_edit.html', form=orderForm, order_id=id)
|
||||
|
||||
|
||||
@order_bp.route('/<id>/create', methods=['POST'])
|
||||
def order_item_create(id):
|
||||
current_order = Order.query.filter(Order.id == id).first()
|
||||
|
@ -90,7 +93,6 @@ def order_item_create(id):
|
|||
return order(id, form=form)
|
||||
|
||||
|
||||
|
||||
@order_bp.route('/<order_id>/<item_id>/delete')
|
||||
def delete_item(order_id, item_id):
|
||||
item = OrderItem.query.filter(OrderItem.id == item_id).first()
|
||||
|
|
Loading…
Reference in a new issue