summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorJon Bergli Heier <snakebite@jvnv.net>2013-08-14 22:14:55 +0200
committerJon Bergli Heier <snakebite@jvnv.net>2013-08-14 22:14:55 +0200
commitb39121c388ca6b83a2b32977866f395e480e77cf (patch)
treede562568fd7acdf08e4446796bb611c4c0f193c6 /modules
parentb0834f7eac1e1e5bbc481d0069b47a39be3d35b0 (diff)
tracking: Ignore fedex events with missing date or time.
Diffstat (limited to 'modules')
-rw-r--r--modules/tracking.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/modules/tracking.py b/modules/tracking.py
index 1d6a5f7..7cf601f 100644
--- a/modules/tracking.py
+++ b/modules/tracking.py
@@ -183,6 +183,9 @@ class FedexModule(TrackingModule):
results = []
for package in packages:
lastevent = package['scanEventList'][0]
+ # Ignore events with missing date or time, this seems to be a temporary thing.
+ if not lastevent['date'] or not lastevent['time']:
+ continue
date = datetime.datetime.strptime('%s %s' % (lastevent['date'], lastevent['time']), '%Y-%m-%d %H:%M:%S')
if lastevent['gmtOffset']:
tz = pytz.timezone('Etc/GMT' + ('+' if lastevent['gmtOffset'][0] == '-' else '-') + str(int(lastevent['gmtOffset'][1:3])))