summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon Bergli Heier <snakebite@jvnv.net>2011-08-04 13:23:46 +0200
committerJon Bergli Heier <snakebite@jvnv.net>2011-08-04 13:23:46 +0200
commit8c3a3df51eb9ae81f08136f698e1d9c554e33c95 (patch)
tree2eac8c14703996f3fd25296d729e1eeac94e90ac
parent2de5ef2366d7cba91291a350fa5fe3bba007dc24 (diff)
tracking: Set package_results to [] when tm.track() returns None (fixes stale consignments).
-rw-r--r--modules/tracking.py4
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()