fix: syntax error in betting.py after merge conflict resolution
This commit is contained in:
parent
60e4cbfcfb
commit
acb7421cc0
1 changed files with 36 additions and 61 deletions
|
|
@ -532,32 +532,7 @@ async def settle_bets() -> list[tuple[int, str]]:
|
||||||
if not winner:
|
if not winner:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
try:
|
is_draw = (winner.casefold() in _DRAW_NAMES or winner == "Draw")
|
||||||
with get_conn() as conn:
|
|
||||||
cur = conn.cursor(cursor_factory=psycopg2.extras.RealDictCursor)
|
|
||||||
cur.execute(
|
|
||||||
"SELECT * FROM bets WHERE match_id = %s AND status = 'pending'",
|
|
||||||
(match_id,),
|
|
||||||
)
|
|
||||||
bets = cur.fetchall()
|
|
||||||
|
|
||||||
wcur = conn.cursor()
|
|
||||||
for bet in bets:
|
|
||||||
chosen = bet["chosen_team"]
|
|
||||||
bet_won = (chosen == winner)
|
|
||||||
|
|
||||||
if len(score_values) >= 2 and score_values[0][1] == score_values[1][1]:
|
|
||||||
is_draw = True
|
|
||||||
winner = "Draw"
|
|
||||||
else:
|
|
||||||
max_score = -1
|
|
||||||
for name, score_val in score_values:
|
|
||||||
if score_val > max_score:
|
|
||||||
max_score = score_val
|
|
||||||
winner = name
|
|
||||||
|
|
||||||
if not winner:
|
|
||||||
continue
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
with get_conn() as conn:
|
with get_conn() as conn:
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue