Browse Source

Fix game list user id bug

mistress
Daniel Muckerman 3 years ago
parent
commit
e2412d8d62
1 changed files with 3 additions and 3 deletions
  1. +3
    -3
      app.py

+ 3
- 3
app.py View File

@ -229,7 +229,7 @@ def add_game():
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:
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.close()
@ -262,8 +262,8 @@ def generate_game_list():
conn = sqlite3.connect('config/games_in_progress.db')
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()
conn.close()

Loading…
Cancel
Save