This commit is contained in:
spla 2021-01-01 18:59:21 +01:00
pare 7d7ffe3370
commit eb2df2d0a8

Veure arxiu

@ -1044,6 +1044,8 @@ def close_game(username, checkmate):
row = cur.fetchone() row = cur.fetchone()
if row != None:
if row[0] != None: if row[0] != None:
white_rating = row[0] white_rating = row[0]
@ -1052,10 +1054,16 @@ def close_game(username, checkmate):
white_rating = 1500 white_rating = 1500
else:
white_rating = 1500
cur.execute("select elo_rating from players where player_name = (%s)", (black_player,)) cur.execute("select elo_rating from players where player_name = (%s)", (black_player,))
row = cur.fetchone() row = cur.fetchone()
if row != None:
if row[0] != None: if row[0] != None:
black_rating = row[0] black_rating = row[0]
@ -1064,6 +1072,10 @@ def close_game(username, checkmate):
black_rating = 1500 black_rating = 1500
else:
black_rating = 1500
cur.close() cur.close()
except (Exception, psycopg2.DatabaseError) as error: except (Exception, psycopg2.DatabaseError) as error: