From 947a4798f12c02b4c3688b0e99b3b9414b66d595 Mon Sep 17 00:00:00 2001 From: Holger Frey Date: Wed, 11 Oct 2017 14:31:06 +0200 Subject: [PATCH] only notify on order change if not own order --- ordr2/views/orders.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ordr2/views/orders.py b/ordr2/views/orders.py index 264cab4..fc49300 100644 --- a/ordr2/views/orders.py +++ b/ordr2/views/orders.py @@ -37,7 +37,9 @@ def change_in_order_status(request, order, old): order.completed_date = datetime.utcnow() order.completed_by = request.user.user_name - if noteworthy: + if noteworthy and order.created_by != request.user.user_name: + # only notify if the user who changed the order is not the one who + # created it in the first place account = request.dbsession.\ query(User).\ filter_by(user_name=order.created_by).\