From 67de43814a178b909f9aff0b7e0a4a703429c07f Mon Sep 17 00:00:00 2001 From: Martijn Braam Date: Mon, 10 Jan 2022 02:26:02 +0100 Subject: [PATCH] carrier: ups: fix null in address parsing --- shipments/carrier.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/shipments/carrier.py b/shipments/carrier.py index 1eb368d..dda18a5 100644 --- a/shipments/carrier.py +++ b/shipments/carrier.py @@ -270,6 +270,10 @@ class UPS(Carrier): sa.address3 = a['streetAddress3'] sa.postalcode = a['zipCode'] sa.city = a['city'] + if a['state'] is None: + a['state'] = '' + if a['province'] is None: + a['province'] = '' sa.state = (a['state'] + ' ' + a['province']).strip() sa.country = a['country'] result.destination = sa -- 2.45.2