Make ProductPaymentForm's recurring field hidden

This commit is contained in:
PCoder 2018-10-03 22:54:45 +02:00
commit b3e3af1c1a
2 changed files with 17 additions and 1 deletions

View file

@ -109,6 +109,17 @@ class ProductPaymentForm(GenericPaymentForm):
'readonly': 'readonly' }
)
)
if self.product.product_is_subscription:
self.fields['amount'].label = "{amt} ({payment_type})".format(
amt=_('Amount in CHF'),
payment_type=_('Monthly subscription')
)
else:
self.fields['amount'].label = "{amt} ({payment_type})".format(
amt=_('Amount in CHF'),
payment_type = _('One time payment')
)
self.fields['recurring'].widget=forms.HiddenInput()
def clean_amount(self):
amount = self.cleaned_data.get('amount')