Add clean function for variant weight to be zero when form blank

This commit is contained in:
Nathan Chapman 2023-03-13 15:27:24 -06:00
parent ef3d293d5c
commit 72938dcb58

View File

@ -37,6 +37,13 @@ class ProductVariantUpdateForm(forms.ModelForm):
product=self.instance.product
)
def clean_weight(self):
data = self.cleaned_data['weight']
if not data:
data = 0
return data
class CouponForm(forms.ModelForm):
class Meta: