Skip to content

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

Improve readability of code

Adam Bogdał8f6dca1c5bfb
diff --git a/saleor/dashboard/product/forms.py b/saleor/dashboard/product/forms.py
index 7b6ea4023d..d7bd742d16 100644
--- a/saleor/dashboard/product/forms.py
+++ b/saleor/dashboard/product/forms.py
@@ -20,8 +20,8 @@ class ProductClassForm(forms.Form):
def __init__(self, *args, **kwargs):
super(ProductClassForm, self).__init__(*args, **kwargs)
- product_classes = list(PRODUCT_CLASSES.keys())
- self.fields['product_cls'].initial = product_classes[0].__name__
+ product_class = next(iter((PRODUCT_CLASSES)))
+ self.fields['product_cls'].initial = product_class.__name__
class StockForm(forms.ModelForm):