From 8076ab376aa92d1b604448e84071674a575cb6b9 Mon Sep 17 00:00:00 2001 From: pauget Date: Thu, 1 Sep 2005 22:40:25 +0200 Subject: [PATCH] Recherche correcte si un seul champ de recherche. darcs-hash:20050901204025-41617-87fcef00f4400a4914158b4d87c9f1d5850db002.gz --- gestion/ldap_crans.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/gestion/ldap_crans.py b/gestion/ldap_crans.py index 387d9189..427c1588 100755 --- a/gestion/ldap_crans.py +++ b/gestion/ldap_crans.py @@ -550,7 +550,14 @@ class crans_ldap : if not r['machine'] and not r['adherent'] and not r['club'] : # Pas de réponses return result - elif not r['adherent'] and not r['club'] : + elif len(conds) == 1 : + # Filtre sur un seul champ + # => on retourne tout + for i in filtres : + if not r[i] : continue + for res in r[i] : + result[i].append(globals()[i](res,mode,self.conn)) + elif not r['adherent'] and not r['club'] : # Il n'y avait seulement un filtre machine # => on retourne uniquement les machines trouvées for m in r['machine'] :