Skip to content

Commit

Permalink
fix: error when there is no billing address is shopify order (#283)
Browse files Browse the repository at this point in the history
* 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 <ankushmenat@gmail.com>
  • Loading branch information
saadsafda and ankush committed Nov 20, 2023
1 parent 3453b0b commit d1e7354
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ecommerce_integrations/shopify/order.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit d1e7354

Please sign in to comment.