From 0597ef286f59690657ba5cb0c33840b328f52d63 Mon Sep 17 00:00:00 2001 From: Paul Marillonnet Date: Tue, 26 Sep 2017 11:28:51 +0200 Subject: [PATCH] POC Campus Condorcet : affiliate ou member est une affiliation supplementaire --- django/sp_sso/saml/forms.py | 10 +++++----- django/sp_sso/templates/declare_form.html | 1 + django/sp_sso/templates/registration_form.html | 1 + 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/django/sp_sso/saml/forms.py b/django/sp_sso/saml/forms.py index 9b5906b..1ef9f59 100644 --- a/django/sp_sso/saml/forms.py +++ b/django/sp_sso/saml/forms.py @@ -86,11 +86,11 @@ class RegistrationForm(forms.Form): self.fields[field].widget.attrs['readonly'] = True if kwargs['initial'].get('yet_member', '') is False: - additional_choice = (('affiliate', _('Affiliate')),) + extra_affiliation = (('affiliate', _('Affiliate')),) else: - additional_choice = (('member', _('Member')),) - actual_affiliation_choices = AFFILIATION_CHOICES + additional_choice - self.fields['ep_primary_affiliation'].choices = actual_affiliation_choices + extra_affiliation = (('member', _('Member')),) + self.fields['ep_affiliation'].choices = extra_affiliation + self.fields['ep_affiliation'].widget.attrs['readonly'] = True nom = forms.CharField(max_length=100, label=_("Last name")) prenom = forms.CharField(max_length=100, label=_("First name")) @@ -111,7 +111,7 @@ class RegistrationForm(forms.Form): ) # eduPersonPrimaryAffiliation ep_affiliation = forms.MultipleChoiceField( - required=False, choices=AFFILIATION_CHOICES, label=_("Affiliations")) + required=False, choices=AFFILIATION_CHOICES, label=_("Extra affiliations")) # s_* -> supannPerson attributes: # supannEtablissement diff --git a/django/sp_sso/templates/declare_form.html b/django/sp_sso/templates/declare_form.html index 8407eb0..717d5ed 100644 --- a/django/sp_sso/templates/declare_form.html +++ b/django/sp_sso/templates/declare_form.html @@ -20,6 +20,7 @@ {% include "registration_field.html" with field=form.s_etablissement %} {% include "registration_field.html" with field=form.invite_unite %} {% include "registration_field.html" with field=form.ep_primary_affiliation %} + {% include "registration_field.html" with field=form.ep_affiliation %} {% include "registration_field.html" with field=form.s_emp_corps %} {% include "registration_field.html" with field=form.s_liste_rouge %} {{ form.ep_principal_name.as_hidden }} diff --git a/django/sp_sso/templates/registration_form.html b/django/sp_sso/templates/registration_form.html index 05c04a9..ed2222b 100644 --- a/django/sp_sso/templates/registration_form.html +++ b/django/sp_sso/templates/registration_form.html @@ -19,6 +19,7 @@ {% include "registration_field.html" with field=form.email %} {% include "registration_field.html" with field=form.s_etablissement %} {% include "registration_field.html" with field=form.ep_primary_affiliation %} + {% include "registration_field.html" with field=form.ep_affiliation %} {% include "registration_field.html" with field=form.s_emp_corps %} {% include "registration_field.html" with field=form.s_liste_rouge %}