diff --git a/tournaments/models/player_registration.py b/tournaments/models/player_registration.py index 5c8cdf6..81879bd 100644 --- a/tournaments/models/player_registration.py +++ b/tournaments/models/player_registration.py @@ -85,7 +85,9 @@ class PlayerRegistration(TournamentSubModel): return "Anonyme" name = self.name() if (len(name) > 20 or forced) and self.first_name: - if self.first_name and len(self.first_name) > 0: + if self.last_name is None: + name = self.first_name + elif self.first_name and len(self.first_name) > 0: name = f"{self.first_name[0]}. {self.last_name}" if len(name) > 20 or forced: name_parts = self.last_name.split(" ") diff --git a/tournaments/models/round.py b/tournaments/models/round.py index e776592..2379a8c 100644 --- a/tournaments/models/round.py +++ b/tournaments/models/round.py @@ -112,6 +112,9 @@ class Round(TournamentSubModel): return True def prepare_match_group(self, next_round, parent_round, loser_final, double_butterfly_mode, secondHalf): + short_names = double_butterfly_mode + if double_butterfly_mode and self.tournament.rounds.count() < 3: + short_names = False matches = self.matches.filter(disabled=False).order_by('index') if len(matches) == 0: return None @@ -211,7 +214,7 @@ class Round(TournamentSubModel): matches=first_half_matches, round_id=self.id, round_index=self.index, - short_names=double_butterfly_mode + short_names=short_names ) return match_group