diff options
author | Jon Bergli Heier <snakebite@jvnv.net> | 2013-08-14 22:14:55 +0200 |
---|---|---|
committer | Jon Bergli Heier <snakebite@jvnv.net> | 2013-08-14 22:14:55 +0200 |
commit | b39121c388ca6b83a2b32977866f395e480e77cf (patch) | |
tree | de562568fd7acdf08e4446796bb611c4c0f193c6 /modules | |
parent | b0834f7eac1e1e5bbc481d0069b47a39be3d35b0 (diff) |
tracking: Ignore fedex events with missing date or time.
Diffstat (limited to 'modules')
-rw-r--r-- | modules/tracking.py | 3 |
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]))) |