backends: ldap attributes are list, take the first value for email

This commit is contained in:
Benjamin Dauvergne 2013-07-30 10:00:03 +02:00
parent a22d107ae7
commit 2a313c7295
2 changed files with 3 additions and 3 deletions

View File

@ -1,4 +1,4 @@
VERSION=0.14
VERSION=0.15
package:
git archive -o ../appli-logement-$(VERSION).tar --prefix=appli-logement-$(VERSION)/ HEAD

View File

@ -124,8 +124,8 @@ class ProfilRechercheAuthentification(ProfilMoteurAuthentification):
def creation_du_compte(self, identifiant, cas_url, ldap_resultat):
'''Création de compte depuis le LDAP
'''
email = ldap_resultat[0][1].get(self.MAIL)
email = email or ldap_resultat[0][1].get(self.SUPANN_MAIL_PERSO)
email = ldap_resultat[0][1].get(self.MAIL, [''])[0]
email = email or ldap_resultat[0][1].get(self.SUPANN_MAIL_PERSO, [''])[0]
email = email or ''
return self.profil_classe.new_cas_user(identifiant, email, cas_url)