Better ref logic and better redundancy on the scheduling

This commit is contained in:
2026-06-01 14:22:12 +02:00 Verified
parent 1dc3998489
commit d414f28cf5
3 changed files with 92 additions and 82 deletions
+5 -3
View File
@@ -1,7 +1,7 @@
# backend/app/crud.py
from uuid import uuid4
from sqlalchemy.orm import Session
from sqlalchemy.orm import Session, joinedload
from . import logic, models, schemas
@@ -201,10 +201,12 @@ def get_tournament_matches(db: Session, tournament_id: str):
)
def get_match(db: Session, tournament_id: str, match_id: str):
def get_match(db: Session, match_id: str):
return (
db.query(models.Match)
.filter(models.Match.tournament_id == tournament_id)
.options(
joinedload(models.Match.tournament).joinedload(models.Tournament.matches)
)
.filter(models.Match.id == match_id)
.first()
)