manually set direct first/last names attributes

This commit is contained in:
Frédéric Péters 2016-09-26 10:07:54 +02:00
parent 6f9e3fd272
commit 3c0b46ffb9
1 changed files with 7 additions and 0 deletions

View File

@ -69,6 +69,13 @@ class AuthenticAdapter(DefaultAdapter):
# assume all answers are for Belgium, this may not actually be true
attributes['pays'] = 'Belgique'
# set "direct" first/last names attributes, or they'll get overwritten
# with the value from the SAML assertion and marked as non-verified.
# (because the NRN only return the first first name, not all of them).
user.first_name = attributes.get('prenom') or ''
user.last_name = attributes.get('nom') or ''
user.save()
attribute_mapping = [
('prenom', 'first_name'),
('nom', 'last_name'),