1. Kai Diefenbach
  2. django-lfs

Commits

Maciej Wiśniowski  committed b3b4871

fix AttributeError for OrderItems without product

  • Participants
  • Parent commits 853e7b0
  • 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: