Style changes

- Turns out we use OR elsewhere in expression context (even though it's technically an undocumented behavior), so use it here as well for consistency
- Change indents to match other SQL statement indentation
- Change join condition ordering to put the joined table first (personal nit I enjoy picking)
This commit is contained in:
Ryan Schmidt 2018-06-25 13:39:48 -07:00 committed by GitHub
parent 7552c492d6
commit 4f5d3f1371
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -352,13 +352,13 @@ def get_player_totals(acc, hostmask):
totals = []
for row in c:
tmp[row[0]] = row[1]
c.execute("""SELECT SUM(gp.team_win | gp.indiv_win)
FROM game_player gp
JOIN player pl
ON gp.player = pl.id
JOIN person pe
ON pl.person = pe.id
WHERE pe.id = ?""", (peid,))
c.execute("""SELECT SUM(gp.team_win OR gp.indiv_win)
FROM game_player gp
JOIN player pl
ON pl.id = gp.player
JOIN person pe
ON pe.id = pl.person
WHERE pe.id = ?""", (peid,))
won_games = c.fetchone()[0]
order = role_order()
name = _get_display_name(peid)