Skip to content

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

Remove more unused root arguments

NyanKiyoshif8ef846c3b46
diff --git a/saleor/graphql/account/mutations.py b/saleor/graphql/account/mutations.py
index ce49783680..8b4155689f 100644
--- a/saleor/graphql/account/mutations.py
+++ b/saleor/graphql/account/mutations.py
@@ -301,7 +301,7 @@ class StaffDelete(StaffDeleteMixin, UserDelete):
return user.has_perm('account.manage_staff')
@classmethod
- def perform_mutation(cls, root, info, **data):
+ def perform_mutation(cls, _root, info, **data):
if not cls.user_is_allowed(info.context.user):
raise PermissionDenied()
@@ -484,7 +484,7 @@ class AddressDelete(ModelDeleteMutation):
return super().clean_instance(info, instance)
@classmethod
- def perform_mutation(cls, root, info, **data):
+ def perform_mutation(cls, _root, info, **data):
if not cls.user_is_allowed(info.context.user):
raise PermissionDenied()
diff --git a/saleor/graphql/checkout/mutations.py b/saleor/graphql/checkout/mutations.py
index 4da9524332..faea7ed036 100644
--- a/saleor/graphql/checkout/mutations.py
+++ b/saleor/graphql/checkout/mutations.py
@@ -168,7 +168,7 @@ class CheckoutCreate(ModelMutation, I18nMixin):
add_variant_to_cart(instance, variant, quantity)
@classmethod
- def perform_mutation(cls, root, info, **data):
+ def perform_mutation(cls, _root, info, **data):
user = info.context.user
# `perform_mutation` is overridden to properly get or create a checkout
@@ -207,7 +207,7 @@ class CheckoutLinesAdd(BaseMutation):
description = 'Adds a checkout line to the existing checkout.'
@classmethod
- def perform_mutation(cls, root, info, checkout_id, lines, replace=False):
+ def perform_mutation(cls, _root, info, checkout_id, lines, replace=False):
checkout = cls.get_node_or_error(
info, checkout_id, only_type=Checkout, field='checkout_id')
@@ -335,7 +335,7 @@ class CheckoutShippingAddressUpdate(BaseMutation, I18nMixin):
description = 'Update shipping address in the existing Checkout.'
@classmethod
- def perform_mutation(cls, root, info, checkout_id, shipping_address):
+ def perform_mutation(cls, _root, info, checkout_id, shipping_address):
checkout = cls.get_node_or_error(
info, checkout_id, only_type=Checkout, field='checkout_id')
shipping_address = cls.validate_address(
@@ -369,7 +369,7 @@ class CheckoutBillingAddressUpdate(CheckoutShippingAddressUpdate):
description = 'Update billing address in the existing Checkout.'
@classmethod
- def perform_mutation(cls, root, info, checkout_id, billing_address):
+ def perform_mutation(cls, _root, info, checkout_id, billing_address):
checkout = cls.get_node_or_error(
info, checkout_id, only_type=Checkout, field='checkout_id')
diff --git a/saleor/graphql/core/mutations.py b/saleor/graphql/core/mutations.py
index ab36e006a4..8889bec508 100644
--- a/saleor/graphql/core/mutations.py
+++ b/saleor/graphql/core/mutations.py
@@ -349,7 +349,7 @@ class ModelDeleteMutation(ModelMutation):
"""
@classmethod
- def perform_mutation(cls, root, info, **data):
+ def perform_mutation(cls, _root, info, **data):
"""Perform a mutation that deletes a model instance."""
if not cls.user_is_allowed(info.context.user):
raise PermissionDenied()
@@ -412,7 +412,7 @@ class BaseBulkMutation(BaseMutation):
raise NotImplementedError
@classmethod
- def perform_mutation(cls, root, info, ids):
+ def perform_mutation(cls, _root, info, ids):
"""Perform a mutation that deletes a list of model instances."""
clean_instance_ids, errors = [], {}
instance_model = cls._meta.model
diff --git a/saleor/graphql/order/mutations/draft_orders.py b/saleor/graphql/order/mutations/draft_orders.py
index fa9b9b148e..e7bf2bffc5 100644
--- a/saleor/graphql/order/mutations/draft_orders.py
+++ b/saleor/graphql/order/mutations/draft_orders.py
@@ -180,7 +180,7 @@ class DraftOrderComplete(BaseMutation):
return user.has_perm('order.manage_orders')
@classmethod
- def perform_mutation(cls, root, info, id):
+ def perform_mutation(cls, _root, info, id):
order = cls.get_node_or_error(info, id, only_type=Order)
validate_draft_order(order)
cls.update_user_fields(order)
@@ -278,7 +278,7 @@ class DraftOrderLineDelete(BaseMutation):
return user.has_perm('order.manage_orders')
@classmethod
- def perform_mutation(cls, root, info, id):
+ def perform_mutation(cls, _root, info, id):
line = cls.get_node_or_error(info, id, only_type=OrderLine)
order = line.order
if order.status != OrderStatus.DRAFT:
diff --git a/saleor/graphql/order/mutations/fulfillments.py b/saleor/graphql/order/mutations/fulfillments.py
index 9376648fbc..d101bb06ac 100644
--- a/saleor/graphql/order/mutations/fulfillments.py
+++ b/saleor/graphql/order/mutations/fulfillments.py
@@ -128,7 +128,7 @@ class FulfillmentCreate(BaseMutation):
return user.has_perm('order.manage_orders')
@classmethod
- def perform_mutation(cls, root, info, order, **data):
+ def perform_mutation(cls, _root, info, order, **data):
order = cls.get_node_or_error(
info, order, field='order', only_type=Order)
data = data.get('input')
diff --git a/saleor/graphql/order/mutations/orders.py b/saleor/graphql/order/mutations/orders.py
index 930509e3c4..631b603ca3 100644
--- a/saleor/graphql/order/mutations/orders.py
+++ b/saleor/graphql/order/mutations/orders.py
@@ -266,7 +266,7 @@ class OrderCapture(BaseMutation):
return user.has_perm('order.manage_orders')
@classmethod
- def perform_mutation(cls, root, info, amount, **data):
+ def perform_mutation(cls, _root, info, amount, **data):
if amount <= 0:
raise ValidationError({
'amount': 'Amount should be a positive number.'})
@@ -303,7 +303,7 @@ class OrderVoid(BaseMutation):
return user.has_perm('order.manage_orders')
@classmethod
- def perform_mutation(cls, root, info, **data):
+ def perform_mutation(cls, _root, info, **data):
order = cls.get_node_or_error(
info, data.get('id'), only_type=Order)
payment = order.get_last_payment()
@@ -335,7 +335,7 @@ class OrderRefund(BaseMutation):
return user.has_perm('order.manage_orders')
@classmethod
- def perform_mutation(cls, root, info, amount, **data):
+ def perform_mutation(cls, _root, info, amount, **data):
if amount <= 0:
raise ValidationError({
'amount': 'Amount should be a positive number.'})
diff --git a/saleor/graphql/payment/mutations.py b/saleor/graphql/payment/mutations.py
index f7d7979dbf..0cb40e9bb0 100644
--- a/saleor/graphql/payment/mutations.py
+++ b/saleor/graphql/payment/mutations.py
@@ -108,7 +108,7 @@ class PaymentCapture(BaseMutation):
return user.has_perm('order.manage_orders')
@classmethod
- def perform_mutation(cls, root, info, payment_id, amount=None):
+ def perform_mutation(cls, _root, info, payment_id, amount=None):
payment = cls.get_node_or_error(
info, payment_id, field='payment_id', only_type=Payment)
try:
@@ -128,7 +128,7 @@ class PaymentRefund(PaymentCapture):
return user.has_perm('order.manage_orders')
@classmethod
- def perform_mutation(cls, root, info, payment_id, amount=None):
+ def perform_mutation(cls, _root, info, payment_id, amount=None):
payment = cls.get_node_or_error(
info, payment_id, field='payment_id', only_type=Payment)
try:
diff --git a/saleor/graphql/product/mutations/attributes.py b/saleor/graphql/product/mutations/attributes.py
index 04fc30467f..e2b98d4c87 100644
--- a/saleor/graphql/product/mutations/attributes.py
+++ b/saleor/graphql/product/mutations/attributes.py
@@ -141,7 +141,7 @@ class AttributeCreate(AttributeMixin, ModelMutation):
return user.has_perm('product.manage_products')
@classmethod
- def perform_mutation(cls, root, info, **data):
+ def perform_mutation(cls, _root, info, **data):
product_type = cls.get_node_or_error(
info, data.get('id'), only_type=ProductType)
instance = models.Attribute()
@@ -202,7 +202,7 @@ class AttributeUpdate(AttributeMixin, ModelMutation):
return user.has_perm('product.manage_products')
@classmethod
- def perform_mutation(cls, root, info, id, input):
+ def perform_mutation(cls, _root, info, id, input):
instance = cls.get_node_or_error(info, id, only_type=Attribute)
cleaned_input = cls.clean_input(info, instance, input)
@@ -270,7 +270,7 @@ class AttributeValueCreate(ModelMutation):
return user.has_perm('product.manage_products')
@classmethod
- def perform_mutation(cls, root, info, attribute_id, input):
+ def perform_mutation(cls, _root, info, attribute_id, input):
attribute = cls.get_node_or_error(
info, attribute_id, only_type=Attribute)
diff --git a/saleor/graphql/product/mutations/digital_contents.py b/saleor/graphql/product/mutations/digital_contents.py
index 1c7c543595..2849ffbbda 100644
--- a/saleor/graphql/product/mutations/digital_contents.py
+++ b/saleor/graphql/product/mutations/digital_contents.py
@@ -166,7 +166,7 @@ class DigitalContentUpdate(BaseMutation):
@classmethod
@permission_required('product.manage_products')
- def perform_mutation(cls, root, info, variant_id, **data):
+ def perform_mutation(cls, _root, info, variant_id, **data):
variant = cls.get_node_or_error(
info, variant_id, 'id', only_type=ProductVariant)
diff --git a/saleor/graphql/translations/mutations.py b/saleor/graphql/translations/mutations.py
index 812930c106..62071f9105 100644
--- a/saleor/graphql/translations/mutations.py
+++ b/saleor/graphql/translations/mutations.py
@@ -21,7 +21,7 @@ class BaseTranslateMutation(ModelMutation):
return user.has_perm('site.manage_translations')
@classmethod
- def perform_mutation(cls, root, info, **data):
+ def perform_mutation(cls, _root, info, **data):
model_type = registry.get_type_for_model(cls._meta.model)
instance = cls.get_node_or_error(
info, data['id'], only_type=model_type)