From 8c3a3df51eb9ae81f08136f698e1d9c554e33c95 Mon Sep 17 00:00:00 2001 From: Jon Bergli Heier Date: Thu, 4 Aug 2011 13:23:46 +0200 Subject: tracking: Set package_results to [] when tm.track() returns None (fixes stale consignments). --- modules/tracking.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'modules/tracking.py') 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() -- cgit v1.2.3