From 71911496f65890b182c0c204688ab2c7abc40913 Mon Sep 17 00:00:00 2001 From: John Brooker Date: Tue, 11 Jun 2019 11:51:04 -0700 Subject: [PATCH] Require that the attribute contains something --- devpi_ldap/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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]