Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Do not return cancelled fulfillments in me API
Unknown38acac6d8fe7
diff --git a/saleor/graphql/account/schema.py b/saleor/graphql/account/schema.pyindex f6d9872ade..2b21154d51 100644--- a/saleor/graphql/account/schema.py+++ b/saleor/graphql/account/schema.py@@ -38,6 +38,7 @@ class AccountQueries(graphene.ObjectType):@login_requireddef resolve_me(self, info):+ info.context.kwargs = dict(ignore_cancelled_fulfillment=True)return info.context.user@permission_required('account.manage_staff')diff --git a/saleor/graphql/order/types.py b/saleor/graphql/order/types.pyindex 1f3bab2ea5..c3004e778f 100644--- a/saleor/graphql/order/types.py+++ b/saleor/graphql/order/types.py@@ -3,6 +3,7 @@ import graphene_django_optimizer as gql_optimizerfrom graphene import relayfrom ...order import models+from ...order.models import FulfillmentStatusfrom ...product.templatetags.product_images import get_product_image_thumbnailfrom ..account.types import Userfrom ..core.connection import CountableDjangoObjectType@@ -265,7 +266,12 @@ class Order(CountableDjangoObjectType):@staticmethoddef resolve_fulfillments(self, info):- return self.fulfillments.all().order_by('pk')+ context_kwargs = getattr(info.context, 'kwargs', {})+ if context_kwargs.get('ignore_cancelled_fulfillment', False):+ qs = self.fulfillments.exclude(status=FulfillmentStatus.CANCELED)+ else:+ qs = self.fulfillments.all()+ return qs.order_by('pk')@staticmethoddef resolve_lines(self, info):