diff --git a/tournaments/models/team_registration.py b/tournaments/models/team_registration.py index 02575f7..db38888 100644 --- a/tournaments/models/team_registration.py +++ b/tournaments/models/team_registration.py @@ -188,13 +188,13 @@ class TeamRegistration(SideStoreModel): matches = self.get_matches() upcoming = matches.filter(end_date__isnull=True).order_by('start_date') - print(f"Upcoming matches count: {upcoming.count()}") + # print(f"Upcoming matches count: {upcoming.count()}") return [match.live_match() for match in upcoming] def get_completed_matches(self): matches = self.get_matches() completed = matches.filter(end_date__isnull=False).order_by('-end_date') - print(f"Completed matches count: {completed.count()}") + # print(f"Completed matches count: {completed.count()}") return [match.live_match() for match in completed] def get_statistics(self): diff --git a/tournaments/services/tournament_registration.py b/tournaments/services/tournament_registration.py index e8c198f..44d8b86 100644 --- a/tournaments/services/tournament_registration.py +++ b/tournaments/services/tournament_registration.py @@ -412,6 +412,12 @@ class RegistrationCartManager: else: sex = None + tournament_count = player_data.get('tournament_count') + try: + tournament_played = int(tournament_count) + except ValueError: + tournament_played = None + # Create player registration with all the original fields PlayerRegistration.objects.create( team_registration=team_registration, @@ -423,7 +429,7 @@ class RegistrationCartManager: last_name=player_data.get('last_name'), points=player_data.get('points'), assimilation=player_data.get('assimilation'), - tournament_played=player_data.get('tournament_count'), + tournament_played=tournament_played, ligue_name=player_data.get('ligue_name'), club_name=player_data.get('club_name'), club_code=player_data.get('club_code'),