Skip to content

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

Use more meaningful names in attributes helper

Marcin Gębala74b6111a9fd0
diff --git a/saleor/product/models/utils.py b/saleor/product/models/utils.py
index b347cc787a..624a71b801 100644
--- a/saleor/product/models/utils.py
+++ b/saleor/product/models/utils.py
@@ -2,14 +2,14 @@ from django.utils.encoding import smart_text
def get_attributes_display_map(obj, attributes):
- display = {}
+ display_map = {}
for attribute in attributes:
value = obj.attributes.get(smart_text(attribute.pk))
if value:
choices = {smart_text(a.pk): a for a in attribute.values.all()}
- attr = choices.get(value)
- if attr:
- display[attribute.pk] = attr
+ choice_obj = choices.get(value)
+ if choice_obj:
+ display_map[attribute.pk] = choice_obj
else:
- display[attribute.pk] = value
- return display
+ display_map[attribute.pk] = value
+ return display_map