From c62207a16f21f60608a0dfffb67a3fe4bfea047d Mon Sep 17 00:00:00 2001 From: Nathan Chapman Date: Mon, 26 Jun 2023 07:39:41 -0600 Subject: [PATCH] Add check for NoneType --- storefront/cart.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/storefront/cart.py b/storefront/cart.py index aaaa673..32cfb90 100644 --- a/storefront/cart.py +++ b/storefront/cart.py @@ -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