Skip to content

Commit

Permalink
replace default value for published date with none - fix shopify prod…
Browse files Browse the repository at this point in the history
…ucts syncing error
  • Loading branch information
Moggach committed Jul 11, 2024
1 parent 8c1bee7 commit 0654eb4
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions app/models/wagtail.py
Original file line number Diff line number Diff line change
Expand Up @@ -740,12 +740,6 @@ def sync_from_shopify_product_id(cls, shopify_product_id):
product = shopify.Product.find(shopify_product_id)
metafields = product.metafields()
metafields = metafields_to_dict(metafields)

# TODO adjust this function so that we can get different metafields from merchandise as opposed to books

if not metafields:
print('metafields are empty, skipping product')
return None

if cls.objects.filter(shopify_product_id=shopify_product_id).exists():
return cls.update_instance_for_product(product, metafields)
Expand Down Expand Up @@ -875,7 +869,7 @@ def get_args_for_page(cls, product, metafields):
args = super().get_args_for_page(product, metafields)
args.update(
dict(
published_date=metafields.get("published_date", ""),
published_date=metafields.get("published_date", None),
authors=metafields_array_to_list(metafields.get("author", [])),
forward_by=metafields_array_to_list(metafields.get("forward_by", [])),
original_publisher=metafields.get("original_publisher", ""),
Expand Down

0 comments on commit 0654eb4

Please sign in to comment.