diff --git a/django/sp_sso/saml/forms.py b/django/sp_sso/saml/forms.py index 9cf0224..d8ac38a 100644 --- a/django/sp_sso/saml/forms.py +++ b/django/sp_sso/saml/forms.py @@ -1,7 +1,7 @@ from django.utils.translation import ugettext_lazy as _ from django import forms from .utils import ldap_get_unites, ldap_get_etablissements, sso_attributes, \ - sso_select_attributes, sso_tupled_attributes + sso_select_attributes, sso_tupled_attributes, sso_strict_readonly_attributes AFFILIATION_CHOICES = ( @@ -82,6 +82,9 @@ class RegistrationForm(forms.Form): backend_dict.get(simple_choice)),) self.fields[field].widget.attrs['readonly'] = True + if field in sso_strict_readonly_attributes: + self.fields[field].widget.attrs['readonly'] = True + nom = forms.CharField(max_length=100, label=_("Last name")) prenom = forms.CharField(max_length=100, label=_("First name")) email = forms.CharField(max_length=100, label=_("Email address")) diff --git a/django/sp_sso/saml/utils.py b/django/sp_sso/saml/utils.py index adcc20b..8854ff3 100644 --- a/django/sp_sso/saml/utils.py +++ b/django/sp_sso/saml/utils.py @@ -28,6 +28,8 @@ sso_tupled_attributes = { 's_emp_corps': 'EMP_CORPS_CHOICES' } +sso_strict_readonly_attributes = ['invite_unite'] + supann_host_role_attribute = 'supannRoleGenerique' supann_host_role_value = '{SUPANN}R10' # 'Responsable de mission'