Better ref logic and better redundancy on the scheduling
This commit is contained in:
+5
-3
@@ -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()
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user