updated to check rows returned
This commit is contained in:
@@ -169,8 +169,9 @@ for ldapUser in ldapUsers:
|
|||||||
query = ("SELECT * FROM LDAPUsers WHERE email = '{0}'".format(ldapUser.mail))
|
query = ("SELECT * FROM LDAPUsers WHERE email = '{0}'".format(ldapUser.mail))
|
||||||
logger.debug("Query: {0}".format(query))
|
logger.debug("Query: {0}".format(query))
|
||||||
cursor.execute(query)
|
cursor.execute(query)
|
||||||
|
row_count = cursor.rowcount
|
||||||
sqlLDAPuser = cursor.fetchall()
|
sqlLDAPuser = cursor.fetchall()
|
||||||
if isinstance(sqlLDAPuser[0], int):
|
if row_count == 1:
|
||||||
# User is in the sql table
|
# User is in the sql table
|
||||||
# are they active
|
# are they active
|
||||||
is_active = bool(sqlLDAPuser[4])
|
is_active = bool(sqlLDAPuser[4])
|
||||||
|
|||||||
Reference in New Issue
Block a user