diff --git a/tournaments/models/group_stage.py b/tournaments/models/group_stage.py index 76b5d11..b86ecfa 100644 --- a/tournaments/models/group_stage.py +++ b/tournaments/models/group_stage.py @@ -199,7 +199,11 @@ class GroupStageTeam: self.set_diff = 0 self.game_diff = 0 self.display_set_difference = False - self.weight = team_registration.weight + if team_registration.playerregistration_set.count() == 0: + weight = None + else: + weight = team_registration.weight + self.weight = weight self.team_registration = team_registration self.qualified = team_registration.qualified diff --git a/tournaments/models/team_registration.py b/tournaments/models/team_registration.py index 6fcca5b..5cb4439 100644 --- a/tournaments/models/team_registration.py +++ b/tournaments/models/team_registration.py @@ -58,7 +58,12 @@ class TeamRegistration(models.Model): else: players = list(self.playerregistration_set.all()) if len(players) == 0: - return [] + if self.wild_card_bracket: + return ['Place réservée wildcard'] + elif self.wild_card_group_stage: + return ['Place réservée wildcard'] + else: + return ['Place réservée'] elif len(players) == 1: return [players[0].shortened_name()] else: @@ -270,3 +275,10 @@ class TeamRegistration(models.Model): if p.registered_online: return True return False + + def formatted_special_status(self): + if self.wild_card_bracket: + return "(wildcard tableau)" + if self.wild_card_group_stage: + return "(wildcard poule)" + return "" diff --git a/tournaments/models/team_score.py b/tournaments/models/team_score.py index 9e22b12..4c23ade 100644 --- a/tournaments/models/team_score.py +++ b/tournaments/models/team_score.py @@ -87,8 +87,11 @@ class TeamScore(models.Model): if self.team_registration: id = self.team_registration.id image = self.team_registration.logo - weight = self.team_registration.weight is_winner = self.team_registration.id == match.winning_team_id + if self.team_registration.playerregistration_set.count() == 0: + weight = None + else: + weight = self.team_registration.weight else: id = None image = None diff --git a/tournaments/models/tournament.py b/tournaments/models/tournament.py index b30a4f6..2d6ba1f 100644 --- a/tournaments/models/tournament.py +++ b/tournaments/models/tournament.py @@ -1437,7 +1437,11 @@ class TeamItem: self.names = team_registration.team_names() self.date = team_registration.local_call_date() self.registration_date = team_registration.registration_date - self.weight = team_registration.weight + if team_registration.playerregistration_set.count() == 0: + weight = None + else: + weight = team_registration.weight + self.weight = weight self.initial_weight = team_registration.initial_weight() self.image = team_registration.logo self.stage = "" diff --git a/tournaments/templates/tournaments/broadcast/broadcasted_group_stage.html b/tournaments/templates/tournaments/broadcast/broadcasted_group_stage.html index 6371829..2c3556d 100644 --- a/tournaments/templates/tournaments/broadcast/broadcasted_group_stage.html +++ b/tournaments/templates/tournaments/broadcast/broadcasted_group_stage.html @@ -34,7 +34,7 @@