Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Fix CheckoutByTokenLoader for not exisiting tokens (#7983)

Filip Owczareke832cac90738
diff --git a/saleor/graphql/checkout/dataloaders.py b/saleor/graphql/checkout/dataloaders.py
index a2fa9cde5f..6971b2d836 100644
--- a/saleor/graphql/checkout/dataloaders.py
+++ b/saleor/graphql/checkout/dataloaders.py
@@ -26,7 +26,7 @@ class CheckoutByTokenLoader(DataLoader):
def batch_load(self, keys):
checkouts = Checkout.objects.filter(token__in=keys).in_bulk()
- return [checkouts[token] for token in keys]
+ return [checkouts.get(token) for token in keys]
class CheckoutLinesInfoByCheckoutTokenLoader(DataLoader):