Jacobmadwed commited on
Commit
edbc301
·
verified ·
1 Parent(s): 3db55fd

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -5
app.py CHANGED
@@ -274,10 +274,6 @@ def fetch_fedex_tracking_info(tracking_number):
274
  # Return the delivery time if available, otherwise return the latest event time
275
  last_update_date_time = delivery_time if delivery_time != 'N/A' else latest_event_time
276
 
277
- destination_city = 'N/A'
278
- if 'recipientInformation' in track_results and 'address' in track_results['recipientInformation'] and 'city' in track_results['recipientInformation']['address']:
279
- destination_city = f"{track_results['recipientInformation']['address']['city']}, {track_results['recipientInformation']['address'].get('stateOrProvinceCode', 'N/A')}"
280
-
281
  return {
282
  'status': latest_status.get('statusByLocale', 'N/A'),
283
  'courier': 'FedEx',
@@ -285,7 +281,6 @@ def fetch_fedex_tracking_info(tracking_number):
285
  'latestLocation': location,
286
  'latestCheckpoint': latest_checkpoint,
287
  'lastUpdateDateTime': last_update_date_time,
288
- 'destinationCity': destination_city,
289
  'latestEventId': latest_status.get('code', 'N/A'),
290
  'rawTimestamp': latest_status.get('scanDateTime') or (scan_events[0].get('date') if scan_events else 'N/A')
291
  }
@@ -303,6 +298,7 @@ def fetch_fedex_tracking_info(tracking_number):
303
  raise
304
 
305
 
 
306
  def update_monday_columns(item_id, status, courier, estimatedDelivery, latestLocation, latestCheckpoint, lastUpdateDateTime, latestEventId):
307
  column_values = {
308
  COLUMN_IDS['courier']: courier,
 
274
  # Return the delivery time if available, otherwise return the latest event time
275
  last_update_date_time = delivery_time if delivery_time != 'N/A' else latest_event_time
276
 
 
 
 
 
277
  return {
278
  'status': latest_status.get('statusByLocale', 'N/A'),
279
  'courier': 'FedEx',
 
281
  'latestLocation': location,
282
  'latestCheckpoint': latest_checkpoint,
283
  'lastUpdateDateTime': last_update_date_time,
 
284
  'latestEventId': latest_status.get('code', 'N/A'),
285
  'rawTimestamp': latest_status.get('scanDateTime') or (scan_events[0].get('date') if scan_events else 'N/A')
286
  }
 
298
  raise
299
 
300
 
301
+
302
  def update_monday_columns(item_id, status, courier, estimatedDelivery, latestLocation, latestCheckpoint, lastUpdateDateTime, latestEventId):
303
  column_values = {
304
  COLUMN_IDS['courier']: courier,