1. Kai Diefenbach
  2. django-lfs

Commits

Maciej Wiśniowski  committed 2ac5357

fix AttributeError for OrderItems without product

  • Participants
  • Parent commits 582ca19
  • Branches default

Comments (0)

Files changed (1)

File lfs/marketing/utils.py

View file
     ProductSales.objects.all().delete()
 
     products = {}
-    for order_item in OrderItem.objects.all():
+    for order_item in OrderItem.objects.filter(product__isnull=False):
         if order_item.product.is_variant():
             product = order_item.product.parent
             if product is None: