1
0
mirror of synced 2024-12-18 17:25:54 +01:00

Fix get_games_played to not accidentally see half-created profiles.

This commit is contained in:
Jennifer Taylor 2021-09-10 19:15:20 +00:00
parent fc48c80e3c
commit e4d308e3c9

View File

@ -548,7 +548,7 @@ class UserData(BaseData):
""" """
if not userids: if not userids:
return [] return []
sql = "SELECT version, userid FROM refid WHERE game = :game AND userid IN :userids" sql = "SELECT version, userid FROM refid WHERE game = :game AND userid IN :userids AND refid IN (SELECT refid FROM profile)"
cursor = self.execute(sql, {'game': game.value, 'userids': userids}) cursor = self.execute(sql, {'game': game.value, 'userids': userids})
profilever: Dict[UserID, int] = {} profilever: Dict[UserID, int] = {}
@ -588,7 +588,7 @@ class UserData(BaseData):
Returns: Returns:
A List of Tuples of game, version for each game/version the user has played. A List of Tuples of game, version for each game/version the user has played.
""" """
sql = "SELECT game, version FROM refid WHERE userid = :userid" sql = "SELECT game, version FROM refid WHERE userid = :userid AND refid IN (SELECT refid FROM profile)"
vals: Dict[str, Any] = {'userid': userid} vals: Dict[str, Any] = {'userid': userid}
if game is not None: if game is not None: