Skip to content

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

Rename method to more meaningful

Anna Siwik7c46e46d5e58
diff --git a/saleor/cart/views.py b/saleor/cart/views.py
index 323b75c6f8..702e0225fd 100644
--- a/saleor/cart/views.py
+++ b/saleor/cart/views.py
@@ -123,7 +123,7 @@ def summary(request, cart):
'product': line.variant.product,
'variant': line.variant.name,
'quantity': line.quantity,
- 'attributes': line.variant.display_variant(attributes),
+ 'attributes': line.variant.display_variant_attributes(attributes),
'image': first_image,
'price_per_item': currencyfmt(
price_per_item.gross, price_per_item.currency),
diff --git a/saleor/product/models.py b/saleor/product/models.py
index b965660025..6c8f9f428d 100644
--- a/saleor/product/models.py
+++ b/saleor/product/models.py
@@ -187,7 +187,7 @@ class ProductVariant(models.Model, Item):
app_label = 'product'
def __str__(self):
- return self.name or self.display_variant()
+ return self.name or self.display_variant_attributes()
def check_quantity(self, quantity):
total_available_quantity = self.get_stock_quantity()
@@ -229,7 +229,7 @@ class ProductVariant(models.Model, Item):
def set_attribute(self, pk, value_pk):
self.attributes[smart_text(pk)] = smart_text(value_pk)
- def display_variant(self, attributes=None):
+ def display_variant_attributes(self, attributes=None):
if attributes is None:
attributes = self.product.product_type.variant_attributes.all()
values = get_attributes_display_map(self, attributes)