From 1c98fc9b76c0e6c00708838cbd19353c5ddb3c16 Mon Sep 17 00:00:00 2001 From: glondu Date: Thu, 2 Mar 2006 18:59:51 +0100 Subject: [PATCH] Correction. darcs-hash:20060302175951-68412-22d4ed1f962377a2362925d4b74c39c62ce4150d.gz --- gestion/ldap_crans.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) 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