tournament: fix: serializer

This commit is contained in:
2024-04-25 16:44:36 +02:00
parent 8c22dd28fb
commit 55d29d5763
3 changed files with 6 additions and 4 deletions

View File

@ -65,7 +65,7 @@ class TournamentModel(models.Model):
return game
def get_games(self) -> set[GameModel]:
return {games for games in self.get_games_by_round(i for i in range(1, self.round))}
return [{games for games in self.get_games_by_round(i)} for i in range(1, self.round)]
def get_games_by_round(self, round: int) -> set[GameModel]:
return {tournament_game for tournament_game in TournamentGameModel.objects.filter(tournament=self, round=round)}