diff --git a/gestion/ldap_crans.py b/gestion/ldap_crans.py index a82058e6..86d67896 100755 --- a/gestion/ldap_crans.py +++ b/gestion/ldap_crans.py @@ -694,10 +694,10 @@ class crans_ldap: else: ### Recherche d'une chaine sur tous les champs - conv = { 'machine': machine , 'club': club, 'adherent': adherent } + conv = { 'club': club, 'adherent': adherent } for i in filtres: - cl = conv[i] + cl = conv.get(i) # Construction du filtre filtre = '(&(|' @@ -707,7 +707,13 @@ class crans_ldap: # Recherche for r in self.conn.search_s(self.base_dn,self.scope[i],filtre): - result[i].append( cl(r,mode,self.conn) ) + if i == 'machine': + if r[1].has_key('puissance'): + result['machine'].append(BorneWifi(r, mode, self.conn)) + else: + result['machine'].append(Machine(r, mode, self.conn)) + else: + result[i].append(cl(r, mode, self.conn)) return result