From 7a5327f490445c15f198154ef555b7d9607a6a32 Mon Sep 17 00:00:00 2001 From: Cal Corum Date: Fri, 27 Mar 2026 04:03:55 -0500 Subject: [PATCH] fix: replace integer comparisons on boolean fields with True/False (#69) Closes #69 Co-Authored-By: Claude Sonnet 4.6 --- app/db_engine.py | 12 ++++++------ app/routers_v3/transactions.py | 8 ++++---- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/app/db_engine.py b/app/db_engine.py index 41beeac..69900e5 100644 --- a/app/db_engine.py +++ b/app/db_engine.py @@ -513,12 +513,12 @@ class Team(BaseModel): all_drops = Transaction.select_season(Current.latest().season).where( (Transaction.oldteam == self) & (Transaction.week == current.week + 1) - & (Transaction.cancelled == 0) + & (Transaction.cancelled == False) ) all_adds = Transaction.select_season(Current.latest().season).where( (Transaction.newteam == self) & (Transaction.week == current.week + 1) - & (Transaction.cancelled == 0) + & (Transaction.cancelled == False) ) for move in all_drops: @@ -596,12 +596,12 @@ class Team(BaseModel): all_drops = Transaction.select_season(Current.latest().season).where( (Transaction.oldteam == sil_team) & (Transaction.week == current.week + 1) - & (Transaction.cancelled == 0) + & (Transaction.cancelled == False) ) all_adds = Transaction.select_season(Current.latest().season).where( (Transaction.newteam == sil_team) & (Transaction.week == current.week + 1) - & (Transaction.cancelled == 0) + & (Transaction.cancelled == False) ) for move in all_drops: @@ -679,12 +679,12 @@ class Team(BaseModel): all_drops = Transaction.select_season(Current.latest().season).where( (Transaction.oldteam == lil_team) & (Transaction.week == current.week + 1) - & (Transaction.cancelled == 0) + & (Transaction.cancelled == False) ) all_adds = Transaction.select_season(Current.latest().season).where( (Transaction.newteam == lil_team) & (Transaction.week == current.week + 1) - & (Transaction.cancelled == 0) + & (Transaction.cancelled == False) ) for move in all_drops: diff --git a/app/routers_v3/transactions.py b/app/routers_v3/transactions.py index 2edf14e..4112503 100644 --- a/app/routers_v3/transactions.py +++ b/app/routers_v3/transactions.py @@ -78,14 +78,14 @@ async def get_transactions( transactions = transactions.where(Transaction.player << these_players) if cancelled: - transactions = transactions.where(Transaction.cancelled == 1) + transactions = transactions.where(Transaction.cancelled == True) else: - transactions = transactions.where(Transaction.cancelled == 0) + transactions = transactions.where(Transaction.cancelled == False) if frozen: - transactions = transactions.where(Transaction.frozen == 1) + transactions = transactions.where(Transaction.frozen == True) else: - transactions = transactions.where(Transaction.frozen == 0) + transactions = transactions.where(Transaction.frozen == False) transactions = transactions.order_by(-Transaction.week, Transaction.moveid)