Beispiel #1
0
def get_urls(id):
    get_url_list = f"SELECT long, short FROM urls WHERE userID = { id };"

    get_con = DbCon(get_url_list)
    urls_list = get_con.lookup_execute("long", "short")

    return urls_list
Beispiel #2
0
    def login_user(self):
        login_query = f"SELECT userID, password FROM users WHERE email = '{ self.email }';"

        login_con = DbCon(login_query)
        user_data = login_con.lookup_execute('userID', 'password')

        if len(user_data) == 0:
            return
        else:
            if check_password_hash(user_data[0]['password'], self.password):
                self.id = user_data[0]['userID']
                return
            else:
                return