diff --git a/tournaments/models/tournament.py b/tournaments/models/tournament.py index a7805e6..51dcd7f 100644 --- a/tournaments/models/tournament.py +++ b/tournaments/models/tournament.py @@ -1416,11 +1416,14 @@ class Tournament(BaseModel): else: return True - def umpire_contact(self): + def umpire_contact(self): if self.umpire_custom_contact is not None: print(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): if self.umpire_custom_mail is not None: diff --git a/tournaments/services/email_service.py b/tournaments/services/email_service.py index 6a3a59d..e24aff8 100644 --- a/tournaments/services/email_service.py +++ b/tournaments/services/email_service.py @@ -334,7 +334,8 @@ class TournamentEmailService: def _format_umpire_contact(tournament): contact_parts = [] 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: creator_email = tournament.umpire_mail()