|
@ -229,7 +229,7 @@ def add_game(): |
|
|
c = conn.cursor() |
|
|
c = conn.cursor() |
|
|
|
|
|
|
|
|
if game_title is not None and len(game_title) > 0 and game_link is not None and len(game_link) > 0: |
|
|
if game_title is not None and len(game_title) > 0 and game_link is not None and len(game_link) > 0: |
|
|
c.execute("INSERT INTO games (user_id, game_title, game_link) VALUES (?, ?, ?)", (session['user_id'], game_title, game_link,)) |
|
|
|
|
|
|
|
|
c.execute("INSERT INTO games (user_id, game_title, game_link) VALUES (?, ?, ?)", (current_user.username, game_title, game_link,)) |
|
|
conn.commit() |
|
|
conn.commit() |
|
|
conn.close() |
|
|
conn.close() |
|
|
|
|
|
|
|
@ -262,8 +262,8 @@ def generate_game_list(): |
|
|
conn = sqlite3.connect('config/games_in_progress.db') |
|
|
conn = sqlite3.connect('config/games_in_progress.db') |
|
|
c = conn.cursor() |
|
|
c = conn.cursor() |
|
|
|
|
|
|
|
|
if 'user_id' in session: |
|
|
|
|
|
c.execute('SELECT * FROM games WHERE user_id=?', (session['user_id'], )) |
|
|
|
|
|
|
|
|
if current_user.is_authenticated: |
|
|
|
|
|
c.execute('SELECT * FROM games WHERE user_id=?', (current_user.username, )) |
|
|
rows = c.fetchall() |
|
|
rows = c.fetchall() |
|
|
conn.close() |
|
|
conn.close() |
|
|
|
|
|
|
|
|