|
|
|
|
@ -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(): |
|
|
|
|
|