From 97d9133f40be1224d34b7cfe3325a794700a363b Mon Sep 17 00:00:00 2001 From: Raz Date: Mon, 23 Dec 2024 11:01:04 +0100 Subject: [PATCH] handle automatic waiting list email --- tournaments/signals.py | 28 +++++++++++----------------- 1 file changed, 11 insertions(+), 17 deletions(-) diff --git a/tournaments/signals.py b/tournaments/signals.py index 950396d..2c2eabe 100644 --- a/tournaments/signals.py +++ b/tournaments/signals.py @@ -93,22 +93,16 @@ def unregister_team(sender, instance, **kwargs): else: waiting_other_player = player - if waiting_captain and waiting_captain.source is not PlayerDataSource.ONLINE_REGISTRATION and not waiting_captain.email: - return - - TournamentEmailService.send_out_of_waiting_list_confirmation( - waiting_captain, + if waiting_captain and waiting_captain.source is PlayerDataSource.ONLINE_REGISTRATION and waiting_captain.email: + TournamentEmailService.send_out_of_waiting_list_confirmation( + waiting_captain, + tournament, + waiting_other_player + ) + + if captain and captain.source is PlayerDataSource.ONLINE_REGISTRATION and captain.email: + TournamentEmailService.send_unregistration_confirmation( + captain, tournament, - waiting_other_player + other_player ) - - - - if captain and captain.source is not PlayerDataSource.ONLINE_REGISTRATION and not captain.email: - return - - TournamentEmailService.send_unregistration_confirmation( - captain, - tournament, - other_player - )