From 940a30c6c5a1e86d2705f8d1cd858fb93e2a9fc6 Mon Sep 17 00:00:00 2001 From: Jon Bergli Heier Date: Wed, 25 Feb 2015 12:45:34 +0100 Subject: tracking: tollpost/postnord: Make sure status is set if no location is given. --- modules/tracking.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'modules') diff --git a/modules/tracking.py b/modules/tracking.py index c86ef46..c7d7d11 100644 --- a/modules/tracking.py +++ b/modules/tracking.py @@ -240,6 +240,8 @@ class TollpostModule(TrackingModule): location = lastevent['location'].get('name') or lastevent['location'].get('city') if location: status = '%s (%s)' % (event, location) + else: + status = event results.append(TrackingResult(code, date, status.encode('utf-8'), delivered)) return results @@ -274,6 +276,8 @@ class PostNordModule(TrackingModule): location = lastevent['location'].get('name') or lastevent['location'].get('city') if location: status = '%s (%s)' % (event, location) + else: + status = event results.append(TrackingResult(code, date, status.encode('utf-8'), delivered)) return results -- cgit v1.2.3