Skip to content

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

Validation message as a string

Damian W9876c1136f8f
diff --git a/saleor/core/exceptions.py b/saleor/core/exceptions.py
index 532304bb06..97d3bf54df 100644
--- a/saleor/core/exceptions.py
+++ b/saleor/core/exceptions.py
@@ -28,6 +28,6 @@ class ReadOnlyException(Exception):
class ProductNotPublished(Exception):
def __init__(self, context=None):
- super().__init__(f"Can't create checkout with unpublished product.")
+ super().__init__("Can't create checkout with unpublished product.")
self.context = context
self.code = CheckoutErrorCode.PRODUCT_NOT_PUBLISHED
diff --git a/saleor/graphql/checkout/mutations.py b/saleor/graphql/checkout/mutations.py
index 41b18c41ae..b174ce16c7 100644
--- a/saleor/graphql/checkout/mutations.py
+++ b/saleor/graphql/checkout/mutations.py
@@ -285,7 +285,7 @@ class CheckoutCreate(ModelMutation, I18nMixin):
)
except ProductNotPublished as exc:
raise ValidationError(
- f"Can't create checkout with unpublished product.",
+ "Can't create checkout with unpublished product.",
code=exc.code,
)
# Save provided addresses and associate them to the checkout
@@ -360,7 +360,7 @@ class CheckoutLinesAdd(BaseMutation):
)
except ProductNotPublished as exc:
raise ValidationError(
- f"Can't create checkout with unpublished product.",
+ "Can't create checkout with unpublished product.",
code=exc.code,
)