This script is supposed to pop-up a warningBox when the badgeID that is entered is not found in the database but the script is missing the if( statement and running directly to the messageBox saying the user has logged-in as user None. What am I missing?
badgeID = event.source.parent.getComponent(‘txtBadgeID’).text
exists = system.db.runScalarQuery(“SELECT badge_id FROM users WHERE badge_id LIKE ‘%s’” % badgeID)
userName = system.db.runScalarQuery(“SELECT username FROM users WHERE badge_id LIKE ‘%s’” % badgeID)
if exists == “None”:
system.gui.warningBox(“Username Doesn’t Exist!”)
system.gui.messageBox(“Welcome You are Logged in as: %s” % userName)