Add check for NoneType

This commit is contained in:
Nathan Chapman 2023-06-26 07:39:41 -06:00
parent a3c1cb9ce9
commit c62207a16f

View File

@ -166,7 +166,7 @@ class Cart:
elif item.quantity > item.variant.product.checkout_limit:
messages.warning(self.request, 'Quantity exceeds checkout limit.')
item.quantity = item.variant.product.checkout_limit
elif item.quantity > item.variant.order_limit:
elif item.variant.order_limit and (item.quantity > item.variant.order_limit):
messages.warning(self.request, 'Quantity exceeds order limit.')
item.quantity = item.variant.order_limit