Skip to content

Commit

Permalink
Merge pull request #49 from zestsoftware/zest-fix-searchlist-attributes
Browse files Browse the repository at this point in the history
Skip found LDAP objects that miss required attributes
  • Loading branch information
rnixx committed Sep 6, 2019
2 parents 16e234c + dde8485 commit fdc39be
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 2 additions & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ History
1.0b11 (unreleased)
-------------------

- No changes yet.
- Skip objects that were found in LDAP while searching on several attributes but don't contain the required attribute.
[fredvd, maurits]


1.0b10 (2019-06-30)
Expand Down
5 changes: 4 additions & 1 deletion src/node/ext/ldap/ugm/_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -649,7 +649,10 @@ def raw_search(self, criteria=None, attrlist=None,
if attrlist is not None:
_results = list()
for _, att in results:
principal_id = att[self._key_attr][0]
try:
principal_id = att[self._key_attr][0]
except (KeyError, IndexError):
continue
aliased = self._alias_dict(att)
for key in list(aliased.keys()):
if key not in attrlist:
Expand Down

0 comments on commit fdc39be

Please sign in to comment.