From 4262ee5378db0dc82ff3d8ce09951036e51033fb Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 28 Jul 2026 20:09:08 +0000 Subject: [PATCH] Scope round dependency by tournament --- backend/bracket/routes/util.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/backend/bracket/routes/util.py b/backend/bracket/routes/util.py index 547cca46..2f687744 100644 --- a/backend/bracket/routes/util.py +++ b/backend/bracket/routes/util.py @@ -20,8 +20,15 @@ async def round_dependency(tournament_id: TournamentId, round_id: RoundId) -> Ro round_ = await fetch_one_parsed( database, Round, - "SELECT * FROM rounds WHERE id = :round_id", - {"round_id": round_id}, + """ + SELECT rounds.* + FROM rounds + JOIN stage_items ON stage_items.id = rounds.stage_item_id + JOIN stages ON stages.id = stage_items.stage_id + WHERE rounds.id = :round_id + AND stages.tournament_id = :tournament_id + """, + {"round_id": round_id, "tournament_id": tournament_id}, ) if round_ is None: