|
|
|
|
@ -77,6 +77,13 @@ def unregister_team(sender, instance, **kwargs): |
|
|
|
|
|
|
|
|
|
notify_team(instance, instance.tournament, TeamEmailType.UNREGISTERED) |
|
|
|
|
teams = instance.tournament.teams(True) |
|
|
|
|
|
|
|
|
|
# Check if the team being deleted is in the waiting list |
|
|
|
|
team_being_deleted = next((team for team in teams if team.team_registration.id == instance.id), None) |
|
|
|
|
is_team_in_waiting_list = team_being_deleted and team_being_deleted.team_registration.out_of_tournament() == True |
|
|
|
|
|
|
|
|
|
# Only notify the first waiting list team if the deleted team is NOT in the waiting list |
|
|
|
|
if not is_team_in_waiting_list: |
|
|
|
|
first_waiting_list_team = instance.tournament.first_waiting_list_team(teams) |
|
|
|
|
if first_waiting_list_team and first_waiting_list_team.id != instance.id: |
|
|
|
|
if instance.tournament.automatic_waiting_list(): |
|
|
|
|
|