Skip to content

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

Remove inherting from object in various models

Pacu29393a429f678
diff --git a/saleor/core/utils/translations.py b/saleor/core/utils/translations.py
index 86a32be820..c277432599 100644
--- a/saleor/core/utils/translations.py
+++ b/saleor/core/utils/translations.py
@@ -1,7 +1,7 @@
from django.utils.translation import get_language
-class TranslationWrapper(object):
+class TranslationWrapper:
def __init__(self, instance, locale):
self.instance = instance
self.translation = next((
@@ -21,7 +21,7 @@ class TranslationWrapper(object):
return str(instance)
-class TranslationProxy(object):
+class TranslationProxy:
def __get__(self, instance, owner):
locale = get_language()
diff --git a/saleor/dashboard/product/forms.py b/saleor/dashboard/product/forms.py
index 9d534317d2..e164fdb902 100644
--- a/saleor/dashboard/product/forms.py
+++ b/saleor/dashboard/product/forms.py
@@ -157,7 +157,7 @@ class ProductTypeForm(forms.ModelForm):
self.add_error('has_variants', msg)
-class AttributesMixin(object):
+class AttributesMixin:
"""Form mixin that dynamically adds attribute fields."""
available_attributes = Attribute.objects.none()
diff --git a/saleor/graphql/core/connection.py b/saleor/graphql/core/connection.py
index 6a1629bc72..121e00f3f6 100644
--- a/saleor/graphql/core/connection.py
+++ b/saleor/graphql/core/connection.py
@@ -13,7 +13,7 @@ class NonNullConnection(Connection):
super().__init_subclass_with_meta__(node=node, name=name, **options)
# Override the original EdgeBase type to make to `node` field required.
- class EdgeBase(object):
+ class EdgeBase:
node = Field(
cls._meta.node, description='The item at the end of the edge',
required=True)
diff --git a/saleor/graphql/product/mutations/attributes.py b/saleor/graphql/product/mutations/attributes.py
index 6dd464fb59..eb660e9ddf 100644
--- a/saleor/graphql/product/mutations/attributes.py
+++ b/saleor/graphql/product/mutations/attributes.py
@@ -25,7 +25,7 @@ class AttributeCreateInput(graphene.InputObjectType):
description='Attribute values to be created for this attribute.')
-class AttributeMixin(object):
+class AttributeMixin:
@classmethod
def clean_attribute_value_uniqueness(cls, values, errors, error_msg):
"""Checks if all provided values are unique."""
diff --git a/saleor/graphql/shipping/mutations.py b/saleor/graphql/shipping/mutations.py
index 6a183c144a..b4c00e9e5f 100644
--- a/saleor/graphql/shipping/mutations.py
+++ b/saleor/graphql/shipping/mutations.py
@@ -42,7 +42,7 @@ class ShippingZoneInput(graphene.InputObjectType):
for countries not covered by other zones.""")
-class ShippingZoneMixin(object):
+class ShippingZoneMixin:
@classmethod
def clean_input(cls, info, instance, input, errors):
@@ -111,7 +111,7 @@ class ShippingZoneDelete(ModelDeleteMutation):
return user.has_perm('shipping.manage_shipping')
-class ShippingPriceMixin(object):
+class ShippingPriceMixin:
@classmethod
def clean_input(cls, info, instance, input, errors):