From: Gael Le Mignot Date: Wed, 20 Nov 2019 10:18:35 +0000 (+0100) Subject: Added fascicule form X-Git-Tag: 1.4.1~5^2~12^2~3 X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=660b5500a043d59e8d902cf31283a3239d1b5e4d;p=teleforma.git Added fascicule form --- diff --git a/teleforma/forms.py b/teleforma/forms.py index 4130f9a4..7c08593c 100644 --- a/teleforma/forms.py +++ b/teleforma/forms.py @@ -100,6 +100,11 @@ class UserForm(ModelForm): payment_schedule = ChoiceField(label=_(u'Échéancier de paiement'), choices=payment_schedule_choices, required=True) + + fascicule = forms.ChoiceField(choices = TRUE_FALSE_CHOICES, + label='Envoi des fascicules', + required=False, + widget=forms.Select()) # no model captcha = CaptchaField() @@ -116,7 +121,7 @@ class UserForm(ModelForm): self.fields['last_name'].required = True self.fields['email'].required = True self.user_fields = ['first_name', 'last_name', 'email', 'address', 'address_detail', 'postal_code', 'city', 'country', 'telephone', 'birthday', 'portrait'] - self.training_fields = ['level', 'iej', 'platform_only', 'period', 'training', 'procedure', 'written_speciality', 'oral_1'] + self.training_fields = ['level', 'iej', 'platform_only', 'fascicule', 'period', 'training', 'procedure', 'written_speciality', 'oral_1'] def clean_portrait(self): image = self.cleaned_data['portrait'] @@ -174,7 +179,9 @@ class UserForm(ModelForm): written_speciality=data.get('written_speciality'), oral_1=data.get('oral_1'), promo_code=data.get('promo_code'), - training=data.get('training') + training=data.get('training'), + payment_schedule=data.get('payment_schedule'), + fascicule=data.get('fascicule'), ) student.save() student.trainings.add(data.get('training', None))