apps: remove deletion of email field from user's edit form (fixes #17156)
This commit is contained in:
parent
4ee6f7d986
commit
02b41f9b65
|
@ -129,7 +129,6 @@ class AppConfig(django.apps.AppConfig):
|
|||
del form.fields['creation_partner']
|
||||
del form.fields['creation_domain']
|
||||
if form.instance.ou and form.instance.ou.slug == 'usagers':
|
||||
form.fields['email'].required = True
|
||||
del form.fields['username']
|
||||
for field_name in ['password1', 'password2', 'is_superuser', 'validated',
|
||||
'validation_context', 'validation_date', 'ou']:
|
||||
|
@ -145,7 +144,6 @@ class AppConfig(django.apps.AppConfig):
|
|||
'generate_password',
|
||||
'ou']:
|
||||
del form.fields[field_name]
|
||||
form.fields['email'].required = True
|
||||
# do not allow to move an agent in the usagers OU
|
||||
form.fields['ou'].queryset = form.fields['ou'].queryset.exclude(slug='usagers')
|
||||
|
||||
|
|
Loading…
Reference in New Issue