def check_credentials(username, password): """Verifies credentials for username and password. Returns None on success or a string describing the error on failure""" # Adapt to your needs users = db_handler.get_users() ency_pass = encrypt_handler.for_encrypt_pass(password) for u, p in users.iteritems(): print username, ency_pass if username == u and ency_pass == p: return None else: return u"Incorrect username or password."
def check_credentials(username, password): """Verifies credentials for username and password. Returns None on success or a string describing the error on failure""" # Adapt to your needs users = db_handler.get_users() ency_pass = encrypt_handler.for_encrypt_pass(password) for u, p in users.iteritems(): print username , ency_pass if username == u and ency_pass == p: return None else: return u"Incorrect username or password."
def check_credentials(username, password): """Verifies credentials for username and password. Returns None on success or a string describing the error on failure""" # Adapt to your needs users = db_handler.get_users() ency_pass = encrypt_handler.for_encrypt_pass(password) p = users.get(username) if p == None: return u"User Doest not Exist!" elif ency_pass != p: return u"Incorrect password!" else: return None