diff --git a/circle/dashboard/forms.py b/circle/dashboard/forms.py index 65f402c..0426704 100644 --- a/circle/dashboard/forms.py +++ b/circle/dashboard/forms.py @@ -116,7 +116,7 @@ class VmCustomizeForm(forms.Form): 'min': "1", 'style': "max-width: 60px", 'required': "", - }), initial=1) + }), initial=1, min_value=1) disks = forms.ModelMultipleChoiceField( queryset=None, required=False, @@ -136,12 +136,6 @@ class VmCustomizeForm(forms.Form): template = forms.CharField(widget=forms.HiddenInput()) customized = forms.CharField(widget=forms.HiddenInput()) - def clean_amount(self): - data = self.cleaned_data['amount'] - if data < 1: - data = 1 - return data - def __init__(self, *args, **kwargs): self.user = kwargs.pop("user", None) self.template = kwargs.pop("template", None)