From ec45c79940980a278cf15676b35f12a0f4f6dbda Mon Sep 17 00:00:00 2001 From: Jared Kipe Date: Fri, 18 Feb 2022 14:09:16 -0800 Subject: [PATCH] [IMP] delivery_ups_hibou: handle missing TNT response attributes --- delivery_ups_hibou/models/ups_request_patch.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/delivery_ups_hibou/models/ups_request_patch.py b/delivery_ups_hibou/models/ups_request_patch.py index df7de1c5..7b087508 100644 --- a/delivery_ups_hibou/models/ups_request_patch.py +++ b/delivery_ups_hibou/models/ups_request_patch.py @@ -165,7 +165,7 @@ def patched_get_shipping_price(self, shipment_info, packages, shipper, ship_from _logger.warning('exception during the UPS Time In Transit request. ' + str(e)) tnt_ready = False tnt_response = '-1' - if tnt_ready: + if tnt_ready and hasattr(tnt_response, 'TransitReponse') and hasattr(tnt_response.TransitResponse, 'ServiceSummary'): for service in tnt_response.TransitResponse.ServiceSummary: if TNT_CODE_MAP.get(service.Service.Code) == service_type: if hasattr(service, 'EstimatedArrival') and hasattr(service.EstimatedArrival, 'BusinessDaysInTransit'):