1
0
mirror of https://github.com/kakwa/ldapcherry synced 2024-11-22 09:24:21 +01:00

more logical return for get_user

This commit is contained in:
kakwa 2015-05-24 15:11:49 +02:00
parent b65fe7bc7b
commit efa7012adb

View File

@ -37,7 +37,7 @@ class Backend(ldapcherry.backend.Backend):
def auth(self, username, password): def auth(self, username, password):
binddn = self.get_user(username, False) binddn = self.get_user(username, False)
if binddn: if not binddn is None:
ldap_client = self._connect() ldap_client = self._connect()
try: try:
ldap_client.simple_bind_s(binddn, password) ldap_client.simple_bind_s(binddn, password)
@ -97,7 +97,7 @@ class Backend(ldapcherry.backend.Backend):
) )
if len(r) == 0: if len(r) == 0:
ldap_client.unbind_s() ldap_client.unbind_s()
return False return None
ldap_client.unbind_s() ldap_client.unbind_s()
if attrs: if attrs: