Skip to content

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

Set use_required_attribute to False on some forms

Pacu21886fd7fdc1f
diff --git a/saleor/dashboard/discount/forms.py b/saleor/dashboard/discount/forms.py
index 2440a0df4e..2bc98c6bf0 100644
--- a/saleor/dashboard/discount/forms.py
+++ b/saleor/dashboard/discount/forms.py
@@ -102,6 +102,7 @@ class ValueVoucherForm(forms.ModelForm):
class ProductVoucherForm(forms.ModelForm):
+ use_required_attribute = False
apply_to = forms.ChoiceField(
choices=Voucher.APPLY_TO_PRODUCT_CHOICES, required=False)
@@ -128,6 +129,7 @@ class ProductVoucherForm(forms.ModelForm):
class CategoryVoucherForm(forms.ModelForm):
+ use_required_attribute = False
apply_to = forms.ChoiceField(
choices=Voucher.APPLY_TO_PRODUCT_CHOICES, required=False)
diff --git a/saleor/dashboard/product/forms.py b/saleor/dashboard/product/forms.py
index d3f8737334..5c3444ceed 100644
--- a/saleor/dashboard/product/forms.py
+++ b/saleor/dashboard/product/forms.py
@@ -222,6 +222,7 @@ class StockBulkDeleteForm(forms.Form):
class ProductImageForm(forms.ModelForm):
+ use_required_attribute = False
variants = forms.ModelMultipleChoiceField(
queryset=ProductVariant.objects.none(),
widget=forms.CheckboxSelectMultiple, required=False)