fix court and startdate display when not confirmed

online_registration
Raz 1 year ago
parent 85bea31b66
commit 97c9cf32cd
  1. 8
      tournaments/models/match.py

@ -41,6 +41,8 @@ class Match(models.Model):
if self.tournament().event: if self.tournament().event:
club = self.tournament().event.club club = self.tournament().event.club
if self.confirmed is False:
return ""
if club: if club:
return club.court_name(index) return club.court_name(index)
elif index is not None: elif index is not None:
@ -95,10 +97,16 @@ class Match(models.Model):
return '' return ''
elif self.start_date: elif self.start_date:
if self.started(): if self.started():
if self.confirmed:
return self.formatted_duration() return self.formatted_duration()
else:
return 'À suivre'
else: else:
timezoned_datetime = timezone.localtime(self.start_date) timezoned_datetime = timezone.localtime(self.start_date)
if self.confirmed:
return formats.date_format(timezoned_datetime, format='l H:i') return formats.date_format(timezoned_datetime, format='l H:i')
else:
return f"Estimée : {formats.date_format(timezoned_datetime, format='l H:i')}"
else: else:
return 'À venir...' return 'À venir...'

Loading…
Cancel
Save