Skip to content

Commit

Permalink
Merge pull request #6 from devinmatte/master
Browse files Browse the repository at this point in the history
Adding utf-8 check
  • Loading branch information
liam-middlebrook committed Mar 10, 2018
2 parents c4ccb31 + 555ad15 commit 18efe91
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
14 changes: 12 additions & 2 deletions csh_ldap/group.py
Expand Up @@ -35,10 +35,20 @@ def get_members(self):
"(memberof=%s)" % self.__dn__,
['uid'])

ret = []
for val in res:
val = val[1]['uid'][0]
try:
ret.append(val.decode('utf-8'))
except UnicodeDecodeError:
ret.append(val)
except KeyError:
continue

return [CSHMember(self.__lib__,
result[1]['uid'][0],
result,
uid=True)
for result in res]
for result in ret]

def check_member(self, member, dn=False):
"""Check if a Member is in the bound group.
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Expand Up @@ -6,7 +6,7 @@ summary = CSH LDAP ORM
url = https://github.com/liam-middlebrook/csh_ldap
description-file = README.md
license = MIT
version = 2.0.1
version = 2.0.2
classifier =
Natural Language :: English
Operating System :: POSIX :: Linux

0 comments on commit 18efe91

Please sign in to comment.