sync_v2
Laurent 8 months ago
parent 49123a3b58
commit 810c6578bc
  1. 7
      tournaments/models/tournament.py
  2. 3
      tournaments/services/email_service.py

@ -1416,11 +1416,14 @@ class Tournament(BaseModel):
else: else:
return True return True
def umpire_contact(self): def umpire_contact(self):
if self.umpire_custom_contact is not None: if self.umpire_custom_contact is not None:
print(self.umpire_custom_contact) print(self.umpire_custom_contact)
return self.umpire_custom_contact return self.umpire_custom_contact
return self.event.creator.full_name() if self.event and self.event.creator:
return self.event.creator.full_name()
else:
return None
def umpire_mail(self): def umpire_mail(self):
if self.umpire_custom_mail is not None: if self.umpire_custom_mail is not None:

@ -334,7 +334,8 @@ class TournamentEmailService:
def _format_umpire_contact(tournament): def _format_umpire_contact(tournament):
contact_parts = [] contact_parts = []
creator_full_name = tournament.umpire_contact() creator_full_name = tournament.umpire_contact()
contact_parts.append(creator_full_name) if creator_full_name:
contact_parts.append(creator_full_name)
if not tournament.hide_umpire_mail: if not tournament.hide_umpire_mail:
creator_email = tournament.umpire_mail() creator_email = tournament.umpire_mail()

Loading…
Cancel
Save