handle first and last names like other attributes

This commit is contained in:
Frédéric Péters 2016-09-26 09:07:49 +02:00
parent a838ce4679
commit d89839dd65
2 changed files with 3 additions and 4 deletions

2
debian/control vendored
View File

@ -10,6 +10,6 @@ X-Python-Version: >= 2.6
Package: python-authentic2-auth-fedict
Architecture: all
Depends: ${misc:Depends},
python-authentic2 (>= 2.1.20.1009)
python-authentic2 (>= 2.1.20.1054)
Description: Fedict authentication frontend for Authentic2

View File

@ -64,6 +64,8 @@ class AuthenticAdapter(DefaultAdapter):
attributes['lieuxMariage'] = '|'.join(attributes.get('lieuxMariage'))
attribute_mapping = [
('prenom', 'first_name'),
('nom', 'last_name'),
('commune', 'city'),
('rue', 'street'),
('rue', 'address'), # alternative attribute name
@ -80,9 +82,6 @@ class AuthenticAdapter(DefaultAdapter):
except Attribute.DoesNotExist:
pass
user.first_name = attributes.get('prenom') or ''
user.last_name = attributes.get('nom') or ''
def provision_attribute(self, user, idp, saml_attributes):
super(AuthenticAdapter, self).provision_attribute(user, idp, saml_attributes)
if not user.email: