diff --git a/tournaments/models/group_stage.py b/tournaments/models/group_stage.py index 573923f..ed2c787 100644 --- a/tournaments/models/group_stage.py +++ b/tournaments/models/group_stage.py @@ -76,12 +76,13 @@ class GroupStage(TournamentSubModel): else: previous = self.tournament.get_previous_live_group_stages(self.step - 1) for gs in previous: - team_registration = gs.teams[self.index].team_registration - if team_registration in gs_teams: - team = gs_teams[team_registration] - else: - team = GroupStageTeam(team_registration) - gs_teams[team_registration] = team + if self.index < len(gs.teams): + team_registration = gs.teams[self.index].team_registration + if team_registration in gs_teams: + team = gs_teams[team_registration] + else: + team = GroupStageTeam(team_registration) + gs_teams[team_registration] = team # compute matches for match in self.matches.all():