Commit abdf3988 authored by Daniel Klaffenbach's avatar Daniel Klaffenbach 🐍

ldap: Add workaround for ldap3 issue #177

This fixes Python3 compatibility
parent ab3e68fa
Pipeline #2231 passed with stage
......@@ -33,7 +33,7 @@ class Ldap(object):
def get_attributes(self, username):
conn = self.connection
model_attrs = {}
if conn.search(self.LDAP_PARAMS['base'], '(uid=%s)' %username, attributes=self.LDAP_SYNC_USER_ATTRIBUTES.keys()):
if conn.search(self.LDAP_PARAMS['base'], '(uid=%s)' %username, attributes=tuple(self.LDAP_SYNC_USER_ATTRIBUTES)):
for attr in self.LDAP_SYNC_USER_ATTRIBUTES:
if attr in conn.response[0]['attributes']:
model_attrs[self.LDAP_SYNC_USER_ATTRIBUTES[attr]] = conn.response[0]['attributes'][attr][0]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment