diff --git a/devpi_ldap/main.py b/devpi_ldap/main.py index 825e174..75ec793 100644 --- a/devpi_ldap/main.py +++ b/devpi_ldap/main.py @@ -178,7 +178,7 @@ def _search(self, conn, config, **kw): config['base'], search_filter, search_scope=search_scope, attributes=[attribute_name]) if found: - if any(attribute_name in x.get('attributes', {}) for x in conn.response): + if any(attribute_name in x.get('attributes', {}) and x['attributes'][attribute_name] for x in conn.response): def extract_search(s): if 'attributes' in s: attributes = s['attributes'][attribute_name]