POC Campus Condorcet : l'unite de recherche du membre est un attribut readonly
This commit is contained in:
parent
108bfa8dcd
commit
0b7591e461
|
@ -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"))
|
||||
|
|
|
@ -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'
|
||||
|
||||
|
|
Reference in New Issue