Skip to content

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

Fixed issue when voucher name is optional

jxltom30f7926e5a0a
diff --git a/saleor/checkout/utils.py b/saleor/checkout/utils.py
index a4d4729deb..cf7578b38b 100644
--- a/saleor/checkout/utils.py
+++ b/saleor/checkout/utils.py
@@ -726,7 +726,7 @@ def recalculate_cart_discount(cart, discounts, taxes):
else:
subtotal = cart.get_subtotal(discounts, taxes).gross
cart.discount_amount = min(discount, subtotal)
- cart.discount_name = voucher.name
+ cart.discount_name = str(voucher)
cart.translated_discount_name = (
voucher.translated.name
if voucher.translated.name != voucher.name else '')