diff options
author | Jon Bergli Heier <snakebite@jvnv.net> | 2011-08-04 13:23:46 +0200 |
---|---|---|
committer | Jon Bergli Heier <snakebite@jvnv.net> | 2011-08-04 13:23:46 +0200 |
commit | 8c3a3df51eb9ae81f08136f698e1d9c554e33c95 (patch) | |
tree | 2eac8c14703996f3fd25296d729e1eeac94e90ac | |
parent | 2de5ef2366d7cba91291a350fa5fe3bba007dc24 (diff) |
tracking: Set package_results to [] when tm.track() returns None (fixes stale consignments).
-rw-r--r-- | modules/tracking.py | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/modules/tracking.py b/modules/tracking.py index d4a3e10..254c84f 100644 --- a/modules/tracking.py +++ b/modules/tracking.py @@ -361,9 +361,7 @@ class Module: target = target.encode('utf-8') removed = False tm = tracking_modules[consignment.type]() - package_results = tm.track(consignment.code) - if not package_results: - return + package_results = tm.track(consignment.code) or [] for data in package_results: try: package = session.query(Package).filter(and_(Package.consignment_id == consignment.id, Package.code == data.code)).one() |