From e94ecfe52ceb49b03e9bcfbc542d37d4d16354bc Mon Sep 17 00:00:00 2001 From: PCoder Date: Sun, 23 Sep 2018 12:49:52 +0200 Subject: [PATCH] Change recurring and description to non-required fields + Change amount to Floatfield --- hosting/forms.py | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/hosting/forms.py b/hosting/forms.py index a593e906..fb3ce98a 100644 --- a/hosting/forms.py +++ b/hosting/forms.py @@ -53,21 +53,18 @@ class HostingUserLoginForm(forms.Form): class GenericPaymentForm(forms.Form): - amount = forms.DecimalField(widget=forms.TextInput(), - max_digits=8, - decimal_places=2, - min_value=1) - recurring = forms.BooleanField() + amount = forms.FloatField( + widget=forms.TextInput(), max_value=999999, min_value=1 + ) + recurring = forms.BooleanField(required=False) description = forms.CharField( - widget=forms.Textarea(attrs={'style': "height: 150px;"}) + widget=forms.Textarea(attrs={'style': "height: 150px;"}), + required=False ) class Meta: fields = ['amount', 'recurring', 'description'] - def clean(self): - return self.cleaned_data - class HostingUserSignupForm(forms.ModelForm): confirm_password = forms.CharField(label=_("Confirm Password"),