diff --git a/tournaments/repositories.py b/tournaments/repositories.py index 634a835..d30f636 100644 --- a/tournaments/repositories.py +++ b/tournaments/repositories.py @@ -1,4 +1,3 @@ -from django.utils import timezone from .models import TeamRegistration, PlayerRegistration from .models.player_enums import PlayerSexType, PlayerDataSource from .models.enums import FederalCategory diff --git a/tournaments/services/tournament_registration.py b/tournaments/services/tournament_registration.py index 258b69f..019ef29 100644 --- a/tournaments/services/tournament_registration.py +++ b/tournaments/services/tournament_registration.py @@ -72,13 +72,10 @@ class TournamentRegistrationService: if self._is_already_registered(licence_id): return - if self.request.user.is_authenticated and self.request.user.licence_id is None: + if self.request.user.is_authenticated and self.request.user.licence_id is None and len(self.context['current_players']) == 0: if self._update_user_license(player_data.get('licence_id')) == False: - return - - if self.request.user.licence_id is None and len(self.context['current_players']) == 0: - # if no licence id for authentificated user and trying to add him as first player of the team, we check his federal data - self._handle_invalid_names(licence_id, player_data) + # if no licence id for authentificated user and trying to add him as first player of the team, we check his federal data + self._handle_invalid_names(licence_id, player_data) else: # Handle player data if self.context['add_player_form'].names_is_valid():