From 66a37821a31e17985990145de9018b20938d279b Mon Sep 17 00:00:00 2001 From: Daizy Modi <54097382+DaizyModi@users.noreply.github.com> Date: Tue, 23 Aug 2022 16:48:50 +0530 Subject: [PATCH] fix: phone number mapping in address (#198) * fix: phone number mapping in address * fix: use variable * fix: minor change --- ecommerce_integrations/shopify/customer.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ecommerce_integrations/shopify/customer.py b/ecommerce_integrations/shopify/customer.py index 2b433d77..e4b4b9bc 100644 --- a/ecommerce_integrations/shopify/customer.py +++ b/ecommerce_integrations/shopify/customer.py @@ -121,7 +121,11 @@ def _map_address_fields(shopify_address, customer_name, address_type, email): "state": shopify_address.get("province"), "pincode": shopify_address.get("zip"), "country": shopify_address.get("country"), - "phone": validate_phone_number(shopify_address.get("phone"), throw=False) or None, "email_id": email, } + + phone = shopify_address.get("phone") + if validate_phone_number(phone, throw=False): + address_fields["phone"] = phone + return address_fields