fix big ass close order issue #107

This commit is contained in:
mcbloch 2019-04-05 18:24:24 +02:00
parent dfe04a885d
commit 83e4a10bbc

View file

@ -170,7 +170,7 @@ def close_order(id):
if order is None: if order is None:
abort(404) abort(404)
if (current_user.id == order.courrier_id or current_user.is_admin()) \ if (current_user.id == order.courrier_id or current_user.is_admin()) \
and order.stoptime is None or (order.stoptime > datetime.now()): and (order.stoptime is None or (order.stoptime > datetime.now())):
order.stoptime = datetime.now() order.stoptime = datetime.now()
if order.courrier_id == 0 or order.courrier_id is None: if order.courrier_id == 0 or order.courrier_id is None:
courrier = select_user(order.items) courrier = select_user(order.items)