diff --git a/dashboard/forms.py b/dashboard/forms.py index 36e738e..5348f35 100644 --- a/dashboard/forms.py +++ b/dashboard/forms.py @@ -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: