From 27a2c9d20f7cd68461a77fb09eff5be0c4e35dc0 Mon Sep 17 00:00:00 2001 From: Jon Bergli Heier Date: Thu, 29 Mar 2012 20:07:40 +0200 Subject: tracking: Don't add delivered packages. --- modules/tracking.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/tracking.py b/modules/tracking.py index fc723b3..daad00f 100644 --- a/modules/tracking.py +++ b/modules/tracking.py @@ -381,6 +381,9 @@ class Module: try: package = session.query(Package).filter(and_(Package.consignment_id == consignment.id, Package.code == data.code)).one() except NoResultFound: + # don't add delivered packages + if data.delivered: + continue package = Package(consignment.id, data.code) session.add(package) try: -- cgit v1.2.3