inlines = [PaymentInline, OptionalFeeInline, DiscountInline, PaybackInline]
search_fields = ['user__first_name', 'user__last_name', 'user__username', 'receipt_id']
list_filter = ['user__is_active', 'restricted', 'is_subscribed', 'platform_only', PeriodListFilter,
- 'fascicule', BalanceFilter ]
+ 'fascicule', 'training_adaptability', 'disability', BalanceFilter ]
list_display = ['student_name', 'restricted', 'get_trainings', 'platform_only',
'total_payments', 'total_fees', 'balance', 'balance_intermediary']
readonly_fields = [ 'balance', 'balance_intermediary' ]
courses = ModelChoiceField(label='Matières',
queryset=Course.objects.filter(id__in=settings.TELEFORMA_REGISTER_COURSE_CHOICE))
+ training_adaptability = forms.ChoiceField(choices=TRUE_FALSE_CHOICES,
+ label="Avez-vous besoin d'adaptabilité de formation ?",
+ widget=forms.Select())
+ disability = forms.ChoiceField(choices=TRUE_FALSE_CHOICES,
+ label='Êtes-vous en situation de handicap ?',
+ widget=forms.Select())
+
promo_code = CharField(label=_('Code promo'), max_length=100, required=False)
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', 'lawyer_country', 'different_billing_address', 'billing_address', 'billing_address_detail', 'billing_postal_code', 'billing_city', 'billing_country']
+ self.adaptability_fields = ['training_adaptability', 'disability']
self.training_fields = ['platform_only', 'period', 'training', 'courses']
def clean(self):
platform_only=platform_only,
promo_code=data.get('promo_code'),
payment_schedule=data.get('payment_schedule'),
+ training_adaptability=data.get('training_adaptability') == 'True',
+ disability=data.get('disability') == 'True',
subscription_fees=subscription_fees
)
student.save()
--- /dev/null
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('teleforma', '0014_add_lawyer_country_and_billing_address'),
+ ]
+
+ operations = [
+ migrations.AddField(
+ model_name='student',
+ name='training_adaptability',
+ field=models.BooleanField(blank=True, default=False, verbose_name="besoin d'adaptabilité de formation"),
+ ),
+ migrations.AddField(
+ model_name='student',
+ name='disability',
+ field=models.BooleanField(blank=True, default=False, verbose_name='situation de handicap'),
+ ),
+ ]
fascicule = models.BooleanField(_('envoi des fascicules'), blank=True,
default=False)
+ training_adaptability = models.BooleanField("besoin d'adaptabilité de formation",
+ blank=True, default=False)
+ disability = models.BooleanField('situation de handicap', blank=True,
+ default=False)
payment_type = models.CharField(_('type de paiement'), choices=payment_choices,
max_length=64, blank=True, null=True,
</div>
</fieldset>
+ {% if form.adaptability_fields %}
+ <fieldset style="margin-top: 2em;">
+ <div class="column">
+ {% for fieldname in form.adaptability_fields %}
+ {% with field=form|get_item:fieldname %}
+ <div class="info_champs">
+ <label for="id_{{ field.name }}">
+ {{ field.label }} <span class="required">*</span>
+ </label>
+ <span class="error">
+ {{ field.errors }}
+ </span>
+ {{ field }}
+ </div>
+ {% endwith %}
+ {% endfor %}
+ </div>
+ </fieldset>
+ {% endif %}
+
<h2><img src="{{ STATIC_URL }}teleforma/images/crfpa_formation.svg"
onerror="this.onerror=null; this.src='{{ STATIC_URL }}teleforma/images/crfpa_formation.png'"
alt="votre formation" title="votre formation" class="votreformation"
<td class="bold">{% trans "Birthday" %} : </td>
<td>{{ profile.birthday }}</td>
</tr>
+ <tr>
+ <td class="bold">Besoin d'adaptabilité de formation : </td>
+ <td>{% if student.training_adaptability %}Oui{% else %}Non{% endif %}</td>
+ </tr>
+ <tr>
+ <td class="bold">Situation de handicap : </td>
+ <td>{% if student.disability %}Oui{% else %}Non{% endif %}</td>
+ </tr>
<tr>
<td class="bold">{% trans "Studying level" %} : </td>