From aa39b9f08ba5911284bd917bde39f4447e3f5c22 Mon Sep 17 00:00:00 2001 From: Razmig Sarkissian Date: Wed, 10 Sep 2025 09:05:59 +0200 Subject: [PATCH] Update email service to handle single-player tournament inscription --- tournaments/services/email_service.py | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/tournaments/services/email_service.py b/tournaments/services/email_service.py index 9aeafe9..8b5ed54 100644 --- a/tournaments/services/email_service.py +++ b/tournaments/services/email_service.py @@ -113,11 +113,18 @@ class TournamentEmailService: link_text = f"informations sur {tournament_prefix_that}{tournament_word}" absolute_url = f'{link_text}' - body_parts.extend([ - f"\nDate d'inscription: {inscription_date}", - f"\nÉquipe inscrite: {captain.name()} et {other_player.name()}", - f"\nVoir les {absolute_url}" - ]) + if other_player: + body_parts.extend([ + f"\nDate d'inscription: {inscription_date}", + f"\nÉquipe inscrite: {captain.name()} et {other_player.name()}", + f"\nVoir les {absolute_url}" + ]) + else: + body_parts.extend([ + f"\nDate d'inscription: {inscription_date}", + f"\nVotre inscription: {captain.name()}", + f"\nVoir les {absolute_url}" + ]) # Add payment information if applicable if tournament.should_request_payment():