carrier: dhl: Let's not index the dict with a potentially missing key The 'shipments' key might be still missing, because of any unexpected error.
1 files changed, 1 insertions(+), 1 deletions(-) M shipments/carrier.py
M shipments/carrier.py => shipments/carrier.py +1 -1
@@ 416,7 416,7 @@ class DHL(Carrier): result.status_category = StatusCategory.ERROR result.tracking_url = 'https://www.dhl.com/gb-en/home/tracking/tracking-parcel.html?submit=1&tracking-id=' + code if len(payload['shipments']): if len(payload.get('shipments', '')): payload = payload['shipments'][0] else: result.status = payload['']