diff --git a/gestioncof/autocomplete.py b/gestioncof/autocomplete.py index 65f62fab..7caea48b 100644 --- a/gestioncof/autocomplete.py +++ b/gestioncof/autocomplete.py @@ -56,10 +56,10 @@ def autocomplete(request): # Fetching data from the SPI if hasattr(settings, 'LDAP_SERVER_URL'): # Fetching - ldap_query = '(|{:s})'.format(''.join([ + ldap_query = '(|{:s})'.format(''.join( '(cn=*{bit:s}*)(uid=*{bit:s}*)'.format(bit=bit) for bit in bits if bit.isalnum() - ])) + )) if ldap_query != "(|)": # If none of the bits were legal, we do not perform the query with Connection(settings.LDAP_SERVER_URL) as conn: diff --git a/kfet/autocomplete.py b/kfet/autocomplete.py index 3b5e0ab5..d8582ccb 100644 --- a/kfet/autocomplete.py +++ b/kfet/autocomplete.py @@ -75,10 +75,10 @@ def account_create(request): # Fetching data from the SPI if hasattr(settings, 'LDAP_SERVER_URL'): # Fetching - ldap_query = '(|{:s})'.format(''.join([ + ldap_query = '(|{:s})'.format(''.join( '(cn=*{bit:s}*)(uid=*{bit:s}*)'.format(bit=word) for word in search_words if word.isalnum() - ])) + )) if ldap_query != "(|)": # If none of the bits were legal, we do not perform the query with Connection(settings.LDAP_SERVER_URL) as conn: