Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Reduce queries for products in checkout views
Krzysztof Wolski499f41393f12
diff --git a/saleor/checkout/core.py b/saleor/checkout/core.pyindex e58ee17dcf..ae7f5e3ba7 100644--- a/saleor/checkout/core.py+++ b/saleor/checkout/core.py@@ -7,6 +7,7 @@ from django.forms.models import model_to_dictfrom django.utils.encoding import smart_textfrom prices import Price, FixedDiscount+from ..cart.models import Cartfrom ..cart.utils import get_or_empty_db_cartfrom ..core import analyticsfrom ..discount.models import Voucher, NotApplicable@@ -319,7 +320,8 @@ class Checkout(object):def load_checkout(view):@wraps(view)- @get_or_empty_db_cart()+ @get_or_empty_db_cart(Cart.objects.all().prefetch_related(+ 'lines__variant__product'))def func(request, cart):try:session_data = request.session[STORAGE_SESSION_KEY]