Skip to content

Commit

Permalink
fix: woocom import (#23)
Browse files Browse the repository at this point in the history
  • Loading branch information
qasimgulzar authored Jan 6, 2025
1 parent 71e87b2 commit 0c810f1
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions celery_tasks/wordpress_import_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,12 @@ def create_category(breadcrumbs_list):
for woo_option in woo_option_group['options']:
AttributeOption.objects.get_or_create(group=option_group, option=woo_option)

ProductAttribute.objects.get_or_create(
product_class=product_class, name=option_group.name, code=slugify(option_group.name),
type='option', option_group=option_group)
try:
ProductAttribute.objects.get_or_create(
product_class=product_class, name=option_group.name, code=slugify(option_group.name),
type='option', option_group=option_group)
except Exception as e:
logger.error(e)
oscar_product.product_class = product_class
oscar_product.save()

Expand Down

0 comments on commit 0c810f1

Please sign in to comment.