Skip to content

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

Fix multiline descriptions

Marcin Gębala43b12dc3633d
diff --git a/saleor/graphql/account/mutations/account.py b/saleor/graphql/account/mutations/account.py
index c42609e638..bdcbeb01d9 100644
--- a/saleor/graphql/account/mutations/account.py
+++ b/saleor/graphql/account/mutations/account.py
@@ -87,7 +87,7 @@ class AccountRequestDeletion(BaseMutation):
required=True,
description=(
"URL of a view where users should be redirected to "
- "delete their account. URL in RFC 1808 format.",
+ "delete their account. URL in RFC 1808 format."
),
)
diff --git a/saleor/graphql/account/mutations/base.py b/saleor/graphql/account/mutations/base.py
index 4d0ebf770d..4e85a88ae5 100644
--- a/saleor/graphql/account/mutations/base.py
+++ b/saleor/graphql/account/mutations/base.py
@@ -115,7 +115,7 @@ class RequestPasswordReset(BaseMutation):
required=True,
description=(
"URL of a view where users should be redirected to "
- "reset the password. URL in RFC 1808 format.",
+ "reset the password. URL in RFC 1808 format."
),
)
@@ -302,7 +302,7 @@ class UserCreateInput(CustomerInput):
redirect_url = graphene.String(
description=(
"URL of a view where users should be redirected to "
- "set the password. URL in RFC 1808 format.",
+ "set the password. URL in RFC 1808 format."
)
)
diff --git a/saleor/graphql/account/mutations/staff.py b/saleor/graphql/account/mutations/staff.py
index 7bed53b473..64e80937a4 100644
--- a/saleor/graphql/account/mutations/staff.py
+++ b/saleor/graphql/account/mutations/staff.py
@@ -51,7 +51,7 @@ class StaffCreateInput(StaffInput):
redirect_url = graphene.String(
description=(
"URL of a view where users should be redirected to "
- "set the password. URL in RFC 1808 format.",
+ "set the password. URL in RFC 1808 format."
)
)
@@ -382,12 +382,11 @@ class UserAvatarUpdate(BaseMutation):
)
class Meta:
- description = """
- Create a user avatar. Only for staff members. This mutation must
- be sent as a `multipart` request. More detailed specs of the
- upload format can be found here:
- https://github.com/jaydenseric/graphql-multipart-request-spec
- """
+ description = (
+ "Create a user avatar. Only for staff members. This mutation must be sent "
+ "as a `multipart` request. More detailed specs of the upload format can be "
+ "found here: https://github.com/jaydenseric/graphql-multipart-request-spec"
+ )
error_type_class = AccountError
error_type_field = "account_errors"
diff --git a/saleor/graphql/core/mutations.py b/saleor/graphql/core/mutations.py
index c6abf7ac78..fda02b1993 100644
--- a/saleor/graphql/core/mutations.py
+++ b/saleor/graphql/core/mutations.py
@@ -602,7 +602,7 @@ class CreateToken(ObtainJSONWebToken):
class VerifyToken(Verify):
- """Mutation that confirms if token is valid and also return user data."""
+ """Mutation that confirms if token is valid and also returns user data."""
user = graphene.Field(User)
diff --git a/saleor/graphql/core/types/common.py b/saleor/graphql/core/types/common.py
index cb8862e0f0..545aa6ec6c 100644
--- a/saleor/graphql/core/types/common.py
+++ b/saleor/graphql/core/types/common.py
@@ -27,9 +27,10 @@ class CountryDisplay(graphene.ObjectType):
class Error(graphene.ObjectType):
field = graphene.String(
- description="""Name of a field that caused the error. A value of
- `null` indicates that the error isn't associated with a particular
- field.""",
+ description=(
+ "Name of a field that caused the error. A value of `null` indicates that "
+ "the error isn't associated with a particular field."
+ ),
required=False,
)
message = graphene.String(description="The error message.")
diff --git a/saleor/graphql/core/types/money.py b/saleor/graphql/core/types/money.py
index 1ec73e597a..e1f7c1e6f0 100644
--- a/saleor/graphql/core/types/money.py
+++ b/saleor/graphql/core/types/money.py
@@ -38,9 +38,10 @@ class TaxedMoney(graphene.ObjectType):
tax = graphene.Field(Money, description="Amount of taxes.", required=True)
class Meta:
- description = """Represents a monetary value with taxes. In
- cases where taxes were not applied, net and gross values will be equal.
- """
+ description = (
+ "Represents a monetary value with taxes. In cases where taxes were not "
+ "applied, net and gross values will be equal."
+ )
class TaxedMoneyRange(graphene.ObjectType):
diff --git a/saleor/graphql/core/types/upload.py b/saleor/graphql/core/types/upload.py
index bc897182b2..0c55c61044 100644
--- a/saleor/graphql/core/types/upload.py
+++ b/saleor/graphql/core/types/upload.py
@@ -3,10 +3,12 @@ import graphene
class Upload(graphene.types.Scalar):
class Meta:
- description = """Variables of this type must be set to null in
- mutations. They will be replaced with a filename from a following
- multipart part containing a binary file. See:
- https://github.com/jaydenseric/graphql-multipart-request-spec"""
+ description = (
+ "Variables of this type must be set to null in mutations. They will be "
+ "replaced with a filename from a following multipart part containing "
+ "a binary file. "
+ "See: https://github.com/jaydenseric/graphql-multipart-request-spec."
+ )
@staticmethod
def serialize(value):
diff --git a/saleor/graphql/discount/types.py b/saleor/graphql/discount/types.py
index cd8f0bfa88..658d18cb85 100644
--- a/saleor/graphql/discount/types.py
+++ b/saleor/graphql/discount/types.py
@@ -44,9 +44,10 @@ class Sale(CountableDjangoObjectType):
)
class Meta:
- description = """
- Sales allow creating discounts for categories, collections or
- products and are visible to all the customers."""
+ description = (
+ "Sales allow creating discounts for categories, collections or products "
+ "and are visible to all the customers."
+ )
interfaces = [relay.Node]
model = models.Sale
only_fields = ["end_date", "id", "name", "start_date", "type", "value"]
@@ -111,10 +112,11 @@ class Voucher(CountableDjangoObjectType):
)
class Meta:
- description = """
- Vouchers allow giving discounts to particular customers on categories,
- collections or specific products. They can be used during checkout by
- providing valid voucher codes."""
+ description = (
+ "Vouchers allow giving discounts to particular customers on categories, "
+ "collections or specific products. They can be used during checkout by "
+ "providing valid voucher codes."
+ )
only_fields = [
"apply_once_per_order",
"apply_once_per_customer",
diff --git a/saleor/graphql/giftcard/types.py b/saleor/graphql/giftcard/types.py
index ad39ec5602..8692a85ae9 100644
--- a/saleor/graphql/giftcard/types.py
+++ b/saleor/graphql/giftcard/types.py
@@ -16,10 +16,10 @@ class GiftCard(CountableDjangoObjectType):
)
class Meta:
- description = """
- A gift card is a prepaid electronic payment card accepted in stores.
- They can be used during checkout by providing a valid gift
- card codes. """
+ description = (
+ "A gift card is a prepaid electronic payment card accepted in stores. They "
+ "can be used during checkout by providing a valid gift card codes."
+ )
only_fields = [
"user",
"code",
diff --git a/saleor/graphql/menu/mutations.py b/saleor/graphql/menu/mutations.py
index 8d069ba245..ba18326256 100644
--- a/saleor/graphql/menu/mutations.py
+++ b/saleor/graphql/menu/mutations.py
@@ -40,9 +40,7 @@ class MenuItemCreateInput(MenuItemInput):
description="Menu to which item belongs.", name="menu", required=True
)
parent = graphene.ID(
- description="""
- ID of the parent menu. If empty, menu will be top level
- menu.""",
+ description="ID of the parent menu. If empty, menu will be top level menu.",
name="parent",
)
@@ -170,9 +168,10 @@ class MenuItemCreate(ModelMutation):
class Arguments:
input = MenuItemCreateInput(
required=True,
- description="""Fields required to update a menu item.
- Only one of 'url', 'category', 'page', 'collection' is allowed
- per item""",
+ description=(
+ "Fields required to update a menu item. Only one of `url`, `category`, "
+ "`page`, `collection` is allowed per item."
+ ),
)
class Meta:
@@ -216,9 +215,10 @@ class MenuItemUpdate(MenuItemCreate):
id = graphene.ID(required=True, description="ID of a menu item to update.")
input = MenuItemInput(
required=True,
- description="""Fields required to update a menu item.
- Only one of 'url', 'category', 'page', 'collection' is allowed
- per item""",
+ description=(
+ "Fields required to update a menu item. Only one of `url`, `category`, "
+ "`page`, `collection` is allowed per item."
+ ),
)
class Meta:
diff --git a/saleor/graphql/menu/types.py b/saleor/graphql/menu/types.py
index 9eff8e3393..28cb84a85a 100644
--- a/saleor/graphql/menu/types.py
+++ b/saleor/graphql/menu/types.py
@@ -23,8 +23,10 @@ class Menu(CountableDjangoObjectType):
)
class Meta:
- description = """Represents a single menu - an object that is used
- to help navigate through the store."""
+ description = (
+ "Represents a single menu - an object that is used to help navigate "
+ "through the store."
+ )
interfaces = [relay.Node]
only_fields = ["id", "name"]
model = models.Menu
@@ -64,8 +66,10 @@ class MenuItem(CountableDjangoObjectType):
)
class Meta:
- description = """Represents a single item of the related menu.
- Can store categories, collection or pages."""
+ description = (
+ "Represents a single item of the related menu. Can store categories, "
+ "collection or pages."
+ )
interfaces = [relay.Node]
only_fields = [
"category",
diff --git a/saleor/graphql/order/mutations/draft_orders.py b/saleor/graphql/order/mutations/draft_orders.py
index af62e92157..82f74a94a2 100644
--- a/saleor/graphql/order/mutations/draft_orders.py
+++ b/saleor/graphql/order/mutations/draft_orders.py
@@ -57,8 +57,9 @@ class DraftOrderInput(InputObjectType):
class DraftOrderCreateInput(DraftOrderInput):
lines = graphene.List(
OrderLineCreateInput,
- description="""Variant line input consisting of variant ID
- and quantity of products.""",
+ description=(
+ "Variant line input consisting of variant ID and quantity of products."
+ ),
)
diff --git a/saleor/graphql/order/mutations/fulfillments.py b/saleor/graphql/order/mutations/fulfillments.py
index c9b01db117..830ce7cc9c 100644
--- a/saleor/graphql/order/mutations/fulfillments.py
+++ b/saleor/graphql/order/mutations/fulfillments.py
@@ -187,8 +187,7 @@ class FulfillmentCancel(BaseMutation):
)
class Meta:
- description = """Cancels existing fulfillment
- and optionally restocks items."""
+ description = "Cancels existing fulfillment and optionally restocks items."
permissions = ("order.manage_orders",)
error_type_class = OrderError
error_type_field = "order_errors"
diff --git a/saleor/graphql/order/schema.py b/saleor/graphql/order/schema.py
index a8bcf17038..b0c7420f95 100644
--- a/saleor/graphql/order/schema.py
+++ b/saleor/graphql/order/schema.py
@@ -62,8 +62,10 @@ class OrderDraftFilterInput(FilterInputObjectType):
class OrderQueries(graphene.ObjectType):
homepage_events = PrefetchingConnectionField(
OrderEvent,
- description="""List of activity events to display on
- homepage (at the moment it only contains order-events).""",
+ description=(
+ "List of activity events to display on "
+ "homepage (at the moment it only contains order-events)."
+ ),
)
order = graphene.Field(
Order,
diff --git a/saleor/graphql/order/types.py b/saleor/graphql/order/types.py
index fd0d5b3a0b..c837fcbd51 100644
--- a/saleor/graphql/order/types.py
+++ b/saleor/graphql/order/types.py
@@ -199,9 +199,10 @@ class OrderLine(CountableDjangoObjectType):
variant = graphene.Field(
ProductVariant,
required=False,
- description="""
- A purchased product variant. Note: this field may be null if the
- variant has been removed from stock at all.""",
+ description=(
+ "A purchased product variant. Note: this field may be null if the variant "
+ "has been removed from stock at all."
+ ),
)
translated_product_name = graphene.String(
required=True, description="Product name in the customer's language"
@@ -268,8 +269,9 @@ class Order(MetadataObjectType, CountableDjangoObjectType):
)
actions = graphene.List(
OrderAction,
- description="""List of actions that can be performed in
- the current state of an order.""",
+ description=(
+ "List of actions that can be performed in the current state of an order."
+ ),
required=True,
)
available_shipping_methods = graphene.List(
@@ -316,8 +318,7 @@ class Order(MetadataObjectType, CountableDjangoObjectType):
)
total_balance = graphene.Field(
Money,
- description="""The difference between the paid and the order total
- amount.""",
+ description="The difference between the paid and the order total amount.",
required=True,
)
user_email = graphene.String(
diff --git a/saleor/graphql/page/types.py b/saleor/graphql/page/types.py
index 7cb8dd392c..6a8ce6c395 100644
--- a/saleor/graphql/page/types.py
+++ b/saleor/graphql/page/types.py
@@ -21,8 +21,10 @@ class Page(CountableDjangoObjectType):
)
class Meta:
- description = """A static page that can be manually added by a shop
- operator through the dashboard."""
+ description = (
+ "A static page that can be manually added by a shop operator through the "
+ "dashboard."
+ )
only_fields = [
"content",
"content_json",
diff --git a/saleor/graphql/payment/mutations.py b/saleor/graphql/payment/mutations.py
index eea09a0aae..2fbd41f97a 100644
--- a/saleor/graphql/payment/mutations.py
+++ b/saleor/graphql/payment/mutations.py
@@ -39,8 +39,10 @@ class PaymentInput(graphene.InputObjectType):
),
)
billing_address = AddressInput(
- description="""Billing address. If empty, the billing address associated with
- the checkout instance will be used."""
+ description=(
+ "Billing address. If empty, the billing address associated with the "
+ "checkout instance will be used."
+ )
)
diff --git a/saleor/graphql/payment/types.py b/saleor/graphql/payment/types.py
index 4f7f83a21e..ba24135c5d 100644
--- a/saleor/graphql/payment/types.py
+++ b/saleor/graphql/payment/types.py
@@ -71,8 +71,9 @@ class Payment(CountableDjangoObjectType):
)
actions = graphene.List(
OrderAction,
- description="""List of actions that can be performed in
- the current state of a payment.""",
+ description=(
+ "List of actions that can be performed in the current state of a payment."
+ ),
required=True,
)
total = graphene.Field(Money, description="Total amount of the payment.")
diff --git a/saleor/graphql/product/bulk_mutations/products.py b/saleor/graphql/product/bulk_mutations/products.py
index 55542c372d..67b7db6336 100644
--- a/saleor/graphql/product/bulk_mutations/products.py
+++ b/saleor/graphql/product/bulk_mutations/products.py
@@ -109,7 +109,7 @@ class ProductVariantBulkCreate(BaseMutation):
graphene.NonNull(ProductVariant),
required=True,
default_value=[],
- description=("List of the created variants.",),
+ description="List of the created variants.",
)
class Arguments:
diff --git a/saleor/graphql/product/descriptions.py b/saleor/graphql/product/descriptions.py
index 81c0711743..d079fdd0ff 100644
--- a/saleor/graphql/product/descriptions.py
+++ b/saleor/graphql/product/descriptions.py
@@ -3,18 +3,18 @@ class AttributeDescriptions:
NAME = "Name of an attribute displayed in the interface."
SLUG = "Internal representation of an attribute name."
VALUES = "List of attribute's values."
- VALUE_REQUIRED = "Whether the attribute requires values to be passed or not"
- IS_VARIANT_ONLY = "Whether the attribute is for variants only"
+ VALUE_REQUIRED = "Whether the attribute requires values to be passed or not."
+ IS_VARIANT_ONLY = "Whether the attribute is for variants only."
VISIBLE_IN_STOREFRONT = (
- "Whether the attribute should be visible or not in storefront"
+ "Whether the attribute should be visible or not in storefront."
)
- FILTERABLE_IN_STOREFRONT = "Whether the attribute can be filtered in storefront"
- FILTERABLE_IN_DASHBOARD = "Whether the attribute can be filtered in dashboard"
+ FILTERABLE_IN_STOREFRONT = "Whether the attribute can be filtered in storefront."
+ FILTERABLE_IN_DASHBOARD = "Whether the attribute can be filtered in dashboard."
STOREFRONT_SEARCH_POSITION = (
- "The position of the attribute in the storefront navigation (0 by default)"
+ "The position of the attribute in the storefront navigation (0 by default)."
)
AVAILABLE_IN_GRID = (
- "Whether the attribute can be displayed in the admin product list"
+ "Whether the attribute can be displayed in the admin product list."
)
diff --git a/saleor/graphql/product/mutations/attributes.py b/saleor/graphql/product/mutations/attributes.py
index a09095978f..584b1f9d10 100644
--- a/saleor/graphql/product/mutations/attributes.py
+++ b/saleor/graphql/product/mutations/attributes.py
@@ -101,7 +101,7 @@ class ReorderInput(graphene.InputObjectType):
id = graphene.ID(required=True, description="The ID of the item to move.")
sort_order = graphene.Int(
description=(
- "The new relative sorting position of the item (from -inf to +inf)"
+ "The new relative sorting position of the item (from -inf to +inf)."
)
)
diff --git a/saleor/graphql/product/mutations/digital_contents.py b/saleor/graphql/product/mutations/digital_contents.py
index 4f1cd2ec27..055f6f67a3 100644
--- a/saleor/graphql/product/mutations/digital_contents.py
+++ b/saleor/graphql/product/mutations/digital_contents.py
@@ -17,7 +17,8 @@ class DigitalContentInput(graphene.InputObjectType):
)
max_downloads = graphene.Int(
description=(
- "Determines how many times a download link can be accessed by a " "customer"
+ "Determines how many times a download link can be accessed by a "
+ "customer."
),
required=False,
)
@@ -29,7 +30,7 @@ class DigitalContentInput(graphene.InputObjectType):
required=False,
)
automatic_fulfillment = graphene.Boolean(
- description=("Overwrite default automatic_fulfillment setting for variant"),
+ description="Overwrite default automatic_fulfillment setting for variant.",
required=False,
)
@@ -54,10 +55,11 @@ class DigitalContentCreate(BaseMutation):
)
class Meta:
- description = """Create new digital content. This mutation must
- be sent as a `multipart` request. More detailed specs of the upload
- format can be found here:
- https://github.com/jaydenseric/graphql-multipart-request-spec"""
+ description = (
+ "Create new digital content. This mutation must be sent as a `multipart` "
+ "request. More detailed specs of the upload format can be found here: "
+ "https://github.com/jaydenseric/graphql-multipart-request-spec"
+ )
error_type_class = ProductError
error_type_field = "product_errors"
diff --git a/saleor/graphql/product/mutations/products.py b/saleor/graphql/product/mutations/products.py
index 86362de7f1..d98c52c02d 100644
--- a/saleor/graphql/product/mutations/products.py
+++ b/saleor/graphql/product/mutations/products.py
@@ -70,9 +70,10 @@ class CategoryCreate(ModelMutation):
required=True, description="Fields required to create a category."
)
parent_id = graphene.ID(
- description="""
- ID of the parent category. If empty, category will be top level
- category.""",
+ description=(
+ "ID of the parent category. If empty, category will be top level "
+ "category."
+ ),
name="parent",
)
@@ -486,19 +487,23 @@ class ProductInput(graphene.InputObjectType):
seo = SeoInput(description="Search engine optimization fields.")
weight = WeightScalar(description="Weight of the Product.", required=False)
sku = graphene.String(
- description="""Stock keeping unit of a product. Note: this
- field is only used if a product doesn't use variants."""
+ description=(
+ "Stock keeping unit of a product. Note: this field is only used if "
+ "a product doesn't use variants."
+ )
)
quantity = graphene.Int(
- description="""The total quantity of a product available for
- sale. Note: this field is only used if a product doesn't
- use variants."""
+ description=(
+ "The total quantity of a product available for sale. Note: this field is "
+ "only used if a product doesn't use variants."
+ )
)
track_inventory = graphene.Boolean(
- description="""Determines if the inventory of this product
- should be tracked. If false, the quantity won't change when customers
- buy this item. Note: this field is only used if a product doesn't
- use variants."""
+ description=(
+ "Determines if the inventory of this product should be tracked. If false, "
+ "the quantity won't change when customers buy this item. Note: this field "
+ "is only used if a product doesn't use variants."
+ )
)
@@ -992,9 +997,10 @@ class ProductVariantInput(graphene.InputObjectType):
description="The total quantity of this variant available for sale."
)
track_inventory = graphene.Boolean(
- description="""Determines if the inventory of this variant should
- be tracked. If false, the quantity won't change when customers
- buy this item."""
+ description=(
+ "Determines if the inventory of this variant should be tracked. If false, "
+ "the quantity won't change when customers buy this item."
+ )
)
weight = WeightScalar(description="Weight of the Product Variant.", required=False)
@@ -1184,10 +1190,11 @@ class ProductVariantClearPrivateMeta(ClearMetaBaseMutation):
class ProductTypeInput(graphene.InputObjectType):
name = graphene.String(description="Name of the product type.")
has_variants = graphene.Boolean(
- description="""Determines if product of this type has multiple
- variants. This option mainly simplifies product management
- in the dashboard. There is always at least one variant created under
- the hood."""
+ description=(
+ "Determines if product of this type has multiple variants. This option "
+ "mainly simplifies product management in the dashboard. There is always at "
+ "least one variant created under the hood."
+ )
)
product_attributes = graphene.List(
graphene.ID,
@@ -1196,13 +1203,14 @@ class ProductTypeInput(graphene.InputObjectType):
)
variant_attributes = graphene.List(
graphene.ID,
- description="""List of attributes used to distinguish between
- different variants of a product.""",
+ description=(
+ "List of attributes used to distinguish between different variants of "
+ "a product."
+ ),
name="variantAttributes",
)
is_shipping_required = graphene.Boolean(
- description="""Determines if shipping is required for products
- of this variant."""
+ description="Determines if shipping is required for products of this variant."
)
is_digital = graphene.Boolean(
description="Determines if products are digital.", required=False
@@ -1350,10 +1358,11 @@ class ProductImageCreate(BaseMutation):
)
class Meta:
- description = """Create a product image. This mutation must be
- sent as a `multipart` request. More detailed specs of the upload format
- can be found here:
- https://github.com/jaydenseric/graphql-multipart-request-spec"""
+ description = (
+ "Create a product image. This mutation must be sent as a `multipart` "
+ "request. More detailed specs of the upload format can be found here: "
+ "https://github.com/jaydenseric/graphql-multipart-request-spec"
+ )
permissions = ("product.manage_products",)
error_type_class = ProductError
error_type_field = "product_errors"
diff --git a/saleor/graphql/product/schema.py b/saleor/graphql/product/schema.py
index b37e1e7315..5865d12ba7 100644
--- a/saleor/graphql/product/schema.py
+++ b/saleor/graphql/product/schema.py
@@ -142,17 +142,17 @@ class ProductQueries(graphene.ObjectType):
in_category=graphene.Argument(
graphene.ID,
description=(
- "Return attributes for products belonging to the given category. ",
- "DEPRECATED: "
- "Will be removed in Saleor 2.10, use the `filter` field instead.",
+ "Return attributes for products belonging to the given category. "
+ "DEPRECATED: Will be removed in Saleor 2.10, use the `filter` field "
+ "instead."
),
),
in_collection=graphene.Argument(
graphene.ID,
description=(
- "Return attributes for products belonging to the given collection. ",
- "DEPRECATED: "
- "Will be removed in Saleor 2.10, use the `filter` field instead.",
+ "Return attributes for products belonging to the given collection. "
+ "DEPRECATED: Will be removed in Saleor 2.10, use the `filter` "
+ "field instead."
),
),
filter=AttributeFilterInput(description="Filtering options for attributes."),
diff --git a/saleor/graphql/product/types/attributes.py b/saleor/graphql/product/types/attributes.py
index 2fa8e5b240..8dbdf65643 100644
--- a/saleor/graphql/product/types/attributes.py
+++ b/saleor/graphql/product/types/attributes.py
@@ -131,9 +131,10 @@ class Attribute(CountableDjangoObjectType, MetadataObjectType):
)
class Meta:
- description = """
- Custom attribute of a product. Attributes can be
- assigned to products and variants at the product type level."""
+ description = (
+ "Custom attribute of a product. Attributes can be assigned to products and "
+ "variants at the product type level."
+ )
only_fields = ["id", "product_types", "product_variant_types"]
interfaces = [relay.Node]
model = models.Attribute
diff --git a/saleor/graphql/product/types/products.py b/saleor/graphql/product/types/products.py
index 6a47838067..6ad5fd3607 100644
--- a/saleor/graphql/product/types/products.py
+++ b/saleor/graphql/product/types/products.py
@@ -210,10 +210,10 @@ class ProductVariant(CountableDjangoObjectType, MetadataObjectType):
)
price_override = graphene.Field(
Money,
- description="""
- Override the base price of a product if necessary.
- A value of `null` indicates that the default product
- price is used.""",
+ description=(
+ "Override the base price of a product if necessary. A value of `null` "
+ "indicates that the default product price is used."
+ ),
)
price = graphene.Field(
Money,
@@ -225,18 +225,19 @@ class ProductVariant(CountableDjangoObjectType, MetadataObjectType):
)
availability = graphene.Field(
VariantPricingInfo,
- description="""Informs about variant's availability in the
- storefront, current price and discounted price.""",
+ description=(
+ "Informs about variant's availability in the storefront, current price and "
+ "discounted price."
+ ),
deprecation_reason=(
- "DEPRECATED: Will be removed in Saleor 2.10, "
- "has been renamed to 'pricing'."
+ "DEPRECATED: Will be removed in Saleor 2.10, has been renamed to `pricing`."
),
)
pricing = graphene.Field(
VariantPricingInfo,
description=(
- """Lists the storefront variant's pricing,
- the current price and discounts, only meant for displaying"""
+ "Lists the storefront variant's pricing, the current price and discounts, "
+ "only meant for displaying."
),
)
is_available = graphene.Boolean(
@@ -255,10 +256,11 @@ class ProductVariant(CountableDjangoObjectType, MetadataObjectType):
revenue = graphene.Field(
TaxedMoney,
period=graphene.Argument(ReportingPeriod),
- description="""Total revenue generated by a variant in given
- period of time. Note: this field should be queried using
- `reportProductSales` query as it uses optimizations suitable
- for such calculations.""",
+ description=(
+ "Total revenue generated by a variant in given period of time. Note: this "
+ "field should be queried using `reportProductSales` query as it uses "
+ "optimizations suitable for such calculations."
+ ),
)
images = gql_optimizer.field(
graphene.List(
@@ -286,8 +288,9 @@ class ProductVariant(CountableDjangoObjectType, MetadataObjectType):
)
class Meta:
- description = """Represents a version of a product such as
- different size or color."""
+ description = (
+ "Represents a version of a product such as different size or color."
+ )
only_fields = [
"id",
"name",
@@ -413,17 +416,20 @@ class Product(CountableDjangoObjectType, MetadataObjectType):
)
availability = graphene.Field(
ProductPricingInfo,
- description="""Informs about product's availability in the
- storefront, current price and discounts.""",
+ description=(
+ "Informs about product's availability in the storefront, current price and "
+ "discounts."
+ ),
deprecation_reason=(
- "DEPRECATED: Will be removed in Saleor 2.10, "
- "Has been renamed to 'pricing'."
+ "DEPRECATED: Will be removed in Saleor 2.10, Has been renamed to `pricing`."
),
)
pricing = graphene.Field(
ProductPricingInfo,
- description="""Lists the storefront product's pricing,
- the current price and discounts, only meant for displaying.""",
+ description=(
+ "Lists the storefront product's pricing, the current price and discounts, "
+ "only meant for displaying."
+ ),
)
is_available = graphene.Boolean(
description="Whether the product is in stock and visible or not."
@@ -433,8 +439,8 @@ class Product(CountableDjangoObjectType, MetadataObjectType):
Money,
description="The product's default base price.",
deprecation_reason=(
- "DEPRECATED: Will be removed in Saleor 2.10, "
- "has been replaced by 'basePrice'"
+ "DEPRECATED: Will be removed in Saleor 2.10, has been replaced by "
+ "`basePrice`"
),
)
minimal_variant_price = graphene.Field(
@@ -485,8 +491,7 @@ class Product(CountableDjangoObjectType, MetadataObjectType):
slug = graphene.String(required=True, description="The slug of a product.")
class Meta:
- description = """Represents an individual item for sale in the
- storefront."""
+ description = "Represents an individual item for sale in the storefront."
interfaces = [relay.Node]
model = models.Product
only_fields = [
@@ -651,8 +656,10 @@ class ProductType(CountableDjangoObjectType, MetadataObjectType):
)
class Meta:
- description = """Represents a type of product. It defines what
- attributes are available to products of this type."""
+ description = (
+ "Represents a type of product. It defines what attributes are available to "
+ "products of this type."
+ )
interfaces = [relay.Node]
model = models.ProductType
only_fields = [
@@ -819,9 +826,11 @@ class Category(CountableDjangoObjectType, MetadataObjectType):
)
class Meta:
- description = """Represents a single category of products.
- Categories allow to organize products in a tree-hierarchies which can
- be used for navigation in the storefront."""
+ description = (
+ "Represents a single category of products. Categories allow to organize "
+ "products in a tree-hierarchies which can be used for navigation in the "
+ "storefront."
+ )
only_fields = [
"description",
"description_json",
diff --git a/saleor/graphql/shipping/mutations.py b/saleor/graphql/shipping/mutations.py
index 67d9a2894e..545d59131d 100644
--- a/saleor/graphql/shipping/mutations.py
+++ b/saleor/graphql/shipping/mutations.py
@@ -40,9 +40,10 @@ class ShippingZoneInput(graphene.InputObjectType):
graphene.String, description="List of countries in this shipping zone."
)
default = graphene.Boolean(
- description="""
- Default shipping zone will be used
- for countries not covered by other zones."""
+ description=(
+ "Default shipping zone will be used for countries not covered by other "
+ "zones."
+ )
)
diff --git a/saleor/graphql/shipping/types.py b/saleor/graphql/shipping/types.py
index 745bea6b65..955c783f29 100644
--- a/saleor/graphql/shipping/types.py
+++ b/saleor/graphql/shipping/types.py
@@ -27,10 +27,10 @@ class ShippingMethod(CountableDjangoObjectType):
)
class Meta:
- description = """
- Shipping method are the methods you'll use to get
- customer's orders to them.
- They are directly exposed to the customers."""
+ description = (
+ "Shipping method are the methods you'll use to get customer's orders to "
+ "them. They are directly exposed to the customers."
+ )
model = models.ShippingMethod
interfaces = [relay.Node]
only_fields = [
@@ -63,10 +63,11 @@ class ShippingZone(CountableDjangoObjectType):
)
class Meta:
- description = """
- Represents a shipping zone in the shop. Zones are the concept
- used only for grouping shipping methods in the dashboard,
- and are never exposed to the customers directly."""
+ description = (
+ "Represents a shipping zone in the shop. Zones are the concept used only "
+ "for grouping shipping methods in the dashboard, and are never exposed to "
+ "the customers directly."
+ )
model = models.ShippingZone
interfaces = [relay.Node]
only_fields = ["default", "id", "name"]
diff --git a/saleor/graphql/shop/types.py b/saleor/graphql/shop/types.py
index b0251da0a8..9680c61cd1 100644
--- a/saleor/graphql/shop/types.py
+++ b/saleor/graphql/shop/types.py
@@ -65,9 +65,10 @@ class Shop(graphene.ObjectType):
)
authorization_keys = graphene.List(
AuthorizationKey,
- description="""List of configured authorization keys. Authorization
- keys are used to enable third-party OAuth authorization
- (currently Facebook or Google).""",
+ description=(
+ "List of configured authorization keys. Authorization keys are used to "
+ "enable third-party OAuth authorization (currently Facebook or Google)."
+ ),
required=True,
)
countries = graphene.List(
@@ -127,7 +128,7 @@ class Shop(graphene.ObjectType):
description="A language code to return the translation for.",
required=True,
),
- description=("Returns translated Shop fields for the given language code."),
+ description="Returns translated Shop fields for the given language code.",
)
automatic_fulfillment_digital_products = graphene.Boolean(
description="Enable automatic fulfillment for all digital products."
@@ -144,8 +145,9 @@ class Shop(graphene.ObjectType):
)
class Meta:
- description = """
- Represents a shop resource containing general shop data and configuration."""
+ description = (
+ "Represents a shop resource containing general shop data and configuration."
+ )
@staticmethod
@permission_required("site.manage_settings")