Browse Source

only notify on order change if not own order

php2python
Holger Frey 7 years ago
parent
commit
947a4798f1
  1. 4
      ordr2/views/orders.py

4
ordr2/views/orders.py

@ -37,7 +37,9 @@ def change_in_order_status(request, order, old):
order.completed_date = datetime.utcnow() order.completed_date = datetime.utcnow()
order.completed_by = request.user.user_name 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.\ account = request.dbsession.\
query(User).\ query(User).\
filter_by(user_name=order.created_by).\ filter_by(user_name=order.created_by).\