Skip to content

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

Return attribute choice object instead of string

Marcin Gębala82f578e7b93d
diff --git a/saleor/product/forms.py b/saleor/product/forms.py
index e04add0a2d..927176eca8 100644
--- a/saleor/product/forms.py
+++ b/saleor/product/forms.py
@@ -19,7 +19,7 @@ class VariantChoiceIterator(ModelChoiceIterator):
def choice(self, obj):
if self.product:
values = get_attributes_display(obj, self.attributes).values()
- label = ', '.join(values)
+ label = ', '.join([str(value) for value in values])
else:
label = self.field.label_from_instance(obj)
label += ' - ' + gross(obj.get_price())
diff --git a/saleor/product/utils.py b/saleor/product/utils.py
index 8972e31ff3..e6323047fe 100644
--- a/saleor/product/utils.py
+++ b/saleor/product/utils.py
@@ -13,5 +13,5 @@ def get_attributes_display(variant, attributes):
except ValueError:
display[attribute.pk] = value
else:
- display[attribute.pk] = choice.display
+ display[attribute.pk] = choice
return display