updated to check rows returned

This commit is contained in:
2021-11-02 13:03:51 -04:00
parent e915046083
commit 3da9610a06

View File

@@ -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])