diff --git a/seafile-ldap.py b/seafile-ldap.py index 03c03df..d7092a7 100644 --- a/seafile-ldap.py +++ b/seafile-ldap.py @@ -169,8 +169,9 @@ for ldapUser in ldapUsers: query = ("SELECT * FROM LDAPUsers WHERE email = '{0}'".format(ldapUser.mail)) logger.debug("Query: {0}".format(query)) cursor.execute(query) + row_count = cursor.rowcount sqlLDAPuser = cursor.fetchall() - if isinstance(sqlLDAPuser[0], int): + if row_count == 1: # User is in the sql table # are they active is_active = bool(sqlLDAPuser[4])