Skip to content

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

Use smart_text once in display_product

Anna Siwikfc50bc8528b9
diff --git a/saleor/product/models.py b/saleor/product/models.py
index 6c8f9f428d..e1df73c2ee 100644
--- a/saleor/product/models.py
+++ b/saleor/product/models.py
@@ -241,10 +241,11 @@ class ProductVariant(models.Model, Item):
return ''
def display_product(self):
- variant_display = smart_text(self)
- if variant_display:
- return '%s (%s)' % (smart_text(self.product), smart_text(self))
- return '%s' % (smart_text(self.product),)
+ variant_display = str(self)
+ product_display = (
+ '%s (%s)' % (self.product, variant_display)
+ if variant_display else str(self.product))
+ return smart_text(product_display)
def get_first_image(self):
return self.product.get_first_image()