Fix the infofasjson plugin attribute mapping

Signed-off-by: Aurélien Bompard <aurelien@bompard.org>
This commit is contained in:
Aurélien Bompard 2020-09-17 16:59:26 +02:00
parent 191f2f0fcf
commit aca50a00bd
No known key found for this signature in database
GPG key ID: 31584CFEB9BF64AD

View file

@ -8,10 +8,15 @@ import fasjson_client
fasjson_mapping = [
['email', 'email'],
['username', 'username'],
['timezone', 'timezone'],
['username', 'nickname'],
['username', 'preferred_username'],
['timezone', 'zoneinfo'],
['locale', 'locale'],
['human_name', 'human_name'],
['human_name', 'name'],
['givenname', 'given_name'],
['surname', 'family_name'],
['ircnicks', 'ircnicks'],
['gpgkeyids', 'gpg_keyids'],
['groups', 'groups'],
['agreements', 'agreements'],
]
@ -51,7 +56,7 @@ Info plugin that retrieves user data from FASJSON. """
return {}
# assumption that first email is the default
user_data['email'] = user_data['emails'][0]
user_data['email'] = user_data['emails'][0] if user_data['emails'] else None
# add the groups to the user_data
user_data['groups'] = [ g['groupname'] for g in user_group_data]