Skip to content

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

Only include cancelled order for staff

Unknown2f39cdd26c14
diff --git a/saleor/graphql/account/schema.py b/saleor/graphql/account/schema.py
index 2b21154d51..f6d9872ade 100644
--- a/saleor/graphql/account/schema.py
+++ b/saleor/graphql/account/schema.py
@@ -38,7 +38,6 @@ class AccountQueries(graphene.ObjectType):
@login_required
def 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.py
index c3004e778f..c465528f24 100644
--- a/saleor/graphql/order/types.py
+++ b/saleor/graphql/order/types.py
@@ -266,11 +266,11 @@ class Order(CountableDjangoObjectType):
@staticmethod
def 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