From d1e735480e379263e2e4ed6b86e3535093adfb4e Mon Sep 17 00:00:00 2001 From: Muhammad Saad <72243425+saadsafda@users.noreply.github.com> Date: Mon, 20 Nov 2023 16:15:04 +0500 Subject: [PATCH] fix: error when there is no billing address is shopify order (#283) * fix: error when there is no billing address is shopify order * fix: error when there is no billing address is shopify order * chore: unnecessary default --------- Co-authored-by: Ankush Menat --- ecommerce_integrations/shopify/order.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ecommerce_integrations/shopify/order.py b/ecommerce_integrations/shopify/order.py index 39cb4d67..74284cdb 100644 --- a/ecommerce_integrations/shopify/order.py +++ b/ecommerce_integrations/shopify/order.py @@ -38,9 +38,9 @@ def sync_sales_order(payload, request_id=None): create_shopify_log(status="Invalid", message="Sales order already exists, not synced") return try: - shopify_customer = order.get("customer", {}) - shopify_customer["billing_address"] = order.get("billing_address") - shopify_customer["shipping_address"] = order.get("shipping_address") + shopify_customer = order.get("customer") if order.get("customer") is not None else {} + shopify_customer["billing_address"] = order.get("billing_address", "") + shopify_customer["shipping_address"] = order.get("shipping_address", "") customer_id = shopify_customer.get("id") if customer_id: customer = ShopifyCustomer(customer_id=customer_id)