apps: add *_verified attributes in user_info for validated accounts (fixes #24193)
This commit is contained in:
parent
019dfbd590
commit
6bfbf66fcd
|
@ -429,8 +429,17 @@ class AppConfig(django.apps.AppConfig):
|
|||
user.attributes.validation_date.isoformat())
|
||||
user_info['validation_context'] = user.attributes.validation_context
|
||||
# pass user.ou.slug for agent's users
|
||||
if user.ou and user.ou.slug != 'usagers':
|
||||
user_info['ou'] = user.ou.slug
|
||||
if user.ou:
|
||||
if user.ou.slug != 'usagers':
|
||||
user_info['ou'] = user.ou.slug
|
||||
else:
|
||||
if user.attributes.validated:
|
||||
for name in ['first_name', 'last_name',
|
||||
'given_name', 'family_name', 'title',
|
||||
'gender', 'birthdate',
|
||||
'birthplace_insee', 'birthplace',
|
||||
'birthcountry_insee', 'birthcountry']:
|
||||
user_info['%s_verified' % name] = True
|
||||
if 'crown' in scope_set:
|
||||
user_info['preferred_username'] = user.attributes.preferred_username
|
||||
user_info['preferred_givenname'] = user.attributes.preferred_givenname
|
||||
|
|
Loading…
Reference in New Issue