diff --git a/gestioncof/autocomplete.py b/gestioncof/autocomplete.py index 1146e1c0..a9abbad7 100644 --- a/gestioncof/autocomplete.py +++ b/gestioncof/autocomplete.py @@ -60,7 +60,7 @@ def autocomplete(request): '(|(cn=*{bit:s}*)(uid=*{bit:s}*))'.format(bit=bit) for bit in bits if bit.isalnum() )) - if ldap_query != "(|)": + if ldap_query != "(&)": # If none of the bits were legal, we do not perform the query with Connection(settings.LDAP_SERVER_URL) as conn: conn.search( diff --git a/kfet/autocomplete.py b/kfet/autocomplete.py index 2dd3c32f..c0019bf9 100644 --- a/kfet/autocomplete.py +++ b/kfet/autocomplete.py @@ -79,7 +79,7 @@ def account_create(request): '(|(cn=*{bit:s}*)(uid=*{bit:s}*))'.format(bit=word) for word in search_words if word.isalnum() )) - if ldap_query != "(|)": + if ldap_query != "(&)": # If none of the bits were legal, we do not perform the query with Connection(settings.LDAP_SERVER_URL) as conn: conn.search(