X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/1c281eadaa7164d9b6e76be6ae325561c0297965..ea9d7d13a44a6ad6357b1af8c977c27753268521:/src/club/forms.py diff --git a/src/club/forms.py b/src/club/forms.py index 2347e2a61..675c18dc5 100644 --- a/src/club/forms.py +++ b/src/club/forms.py @@ -3,7 +3,7 @@ # from decimal import Decimal from django import forms -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from newsletter.forms import NewsletterForm from . import models, payment_methods from .payu.forms import CardTokenForm @@ -135,7 +135,11 @@ class DonationStep1Form(forms.ModelForm): 'monthly' ] - + def __init__(self, *args, **kwargs): + super().__init__(*args, **kwargs) + club = models.Club.objects.first() + self.fields['custom_amount'].widget.attrs['min'] = club.min_amount + def clean(self): state = {} state['monthly'] = self.cleaned_data['switch'] == 'monthly'