def username_or_email_already_exists(form): username = CredentialsModel.gql("WHERE username = :uname", uname=form['username']).fetch() email = CredentialsModel.gql("WHERE email = :email", email=form['email']).fetch() logging.critical(username) logging.critical(email) if not username and not email: return False # logging.critical('returning false') # logging.critical('returning true') return True
def credentials_valid(form): logging.critical('pinga') v = CredentialsModel.gql("WHERE username = :uname AND password = :passwd", uname = form['username'], passwd = form['password']).fetch() logging.critical('pinga2') # username = form['username'] # password = form['password'] # if username in db and db[username]['password'] == password: # return True # return False if v: return True return False
def db_user_exists(user): return_val = CredentialsModel.gql("WHERE username = :uname", uname=user) if not return_val: return False return True