Handle case when no events are found for a given tracking number.
- Added handling for case when no events are found for a given tracking number.
This commit is contained in:
parent
e5967c7692
commit
ebe1eff2f4
1 changed files with 4 additions and 0 deletions
|
@ -121,6 +121,10 @@ class Tracker:
|
||||||
|
|
||||||
events = sorted(events, key=lambda x: x.event_time, reverse=True)
|
events = sorted(events, key=lambda x: x.event_time, reverse=True)
|
||||||
|
|
||||||
|
if not events:
|
||||||
|
logging.debug(f"No events found for {shipment.tracking_number}")
|
||||||
|
return
|
||||||
|
|
||||||
if latest_known_event:
|
if latest_known_event:
|
||||||
logging.debug(
|
logging.debug(
|
||||||
f"Latest known event for {shipment.tracking_number}: {latest_known_event.event_description} - {latest_known_event.event_time}"
|
f"Latest known event for {shipment.tracking_number}: {latest_known_event.event_description} - {latest_known_event.event_time}"
|
||||||
|
|
Loading…
Reference in a new issue