Skip to content

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

Fix bad logic in sizes getter

NyanKiyoshi4aa64a6cfcbc
diff --git a/saleor/product/migrations/0077_generate_versatile_background_images.py b/saleor/product/migrations/0077_generate_versatile_background_images.py
index 128ca4f668..df6d1e88c2 100644
--- a/saleor/product/migrations/0077_generate_versatile_background_images.py
+++ b/saleor/product/migrations/0077_generate_versatile_background_images.py
@@ -25,10 +25,10 @@ def warm_model_background_images(model: models.Model):
def warm_background_images(*_):
- print('Failed to generate thumbnails for Categories', file=stderr)
+ print('Generating thumbnails for Categories', file=stderr)
warm_model_background_images(Category)
- print('Failed to generate thumbnails for Collections', file=stderr)
+ print('Generating thumbnails for Collections', file=stderr)
warm_model_background_images(Collection)
diff --git a/saleor/product/templatetags/product_images.py b/saleor/product/templatetags/product_images.py
index 02fffbfd25..0e50202dac 100644
--- a/saleor/product/templatetags/product_images.py
+++ b/saleor/product/templatetags/product_images.py
@@ -15,7 +15,7 @@ def get_available_sizes():
rendition_sizes = {}
keys = settings.VERSATILEIMAGEFIELD_RENDITION_KEY_SETS
for dummy_size_group, sizes in keys.items():
- rendition_sizes[dummy_size_group] = tuple(sizes)
+ rendition_sizes[dummy_size_group] = {size for _, size in sizes}
return rendition_sizes