Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Only include cancelled order for staff
Unknown2f39cdd26c14
diff --git a/saleor/graphql/account/schema.py b/saleor/graphql/account/schema.pyindex 2b21154d51..f6d9872ade 100644--- a/saleor/graphql/account/schema.py+++ b/saleor/graphql/account/schema.py@@ -38,7 +38,6 @@ 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 c3004e778f..c465528f24 100644--- a/saleor/graphql/order/types.py+++ b/saleor/graphql/order/types.py@@ -266,11 +266,11 @@ class Order(CountableDjangoObjectType):@staticmethoddef resolve_fulfillments(self, info):- context_kwargs = getattr(info.context, 'kwargs', {})- if context_kwargs.get('ignore_cancelled_fulfillment', False):- qs = self.fulfillments.exclude(status=FulfillmentStatus.CANCELED)- else:+ user = info.context.user+ if user.is_authenticated and user.is_active and user.is_staff:qs = self.fulfillments.all()+ else:+ qs = self.fulfillments.exclude(status=FulfillmentStatus.CANCELED)return qs.order_by('pk')@staticmethod