From 2a313c729541187a938fc64c1ae44c63b7f9ea37 Mon Sep 17 00:00:00 2001 From: Benjamin Dauvergne Date: Tue, 30 Jul 2013 10:00:03 +0200 Subject: [PATCH] backends: ldap attributes are list, take the first value for email --- Makefile | 2 +- appli_project/appli_socle/backends.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index a7b180b..269cc93 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -VERSION=0.14 +VERSION=0.15 package: git archive -o ../appli-logement-$(VERSION).tar --prefix=appli-logement-$(VERSION)/ HEAD diff --git a/appli_project/appli_socle/backends.py b/appli_project/appli_socle/backends.py index 210a79b..0621a6e 100644 --- a/appli_project/appli_socle/backends.py +++ b/appli_project/appli_socle/backends.py @@ -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)