|
|
|
@ -125,12 +125,24 @@ class Tournament(models.Model): |
|
|
|
return None |
|
|
|
return None |
|
|
|
|
|
|
|
|
|
|
|
def tournament_status_display(self): |
|
|
|
def tournament_status_display(self): |
|
|
|
#if self.is_canceled: |
|
|
|
if self.is_canceled is True: |
|
|
|
# return "Annulé" |
|
|
|
return "Annulé" |
|
|
|
|
|
|
|
|
|
|
|
teams = self.teams() |
|
|
|
teams = self.teams() |
|
|
|
|
|
|
|
if self.supposedly_in_progress() or self.end_date is not None: |
|
|
|
|
|
|
|
teams = [t for t in teams if t.stage is not "Attente"] |
|
|
|
if teams is not None and len(teams) > 0: |
|
|
|
if teams is not None and len(teams) > 0: |
|
|
|
return f"{len(teams)} inscriptions" |
|
|
|
word = "équipe" |
|
|
|
|
|
|
|
if len(teams) > 1: |
|
|
|
|
|
|
|
word = word + "s" |
|
|
|
|
|
|
|
return f"{len(teams)} {word}" |
|
|
|
|
|
|
|
else: |
|
|
|
|
|
|
|
return None |
|
|
|
|
|
|
|
if teams is not None and len(teams) > 0: |
|
|
|
|
|
|
|
word = "inscription" |
|
|
|
|
|
|
|
if len(teams) > 1: |
|
|
|
|
|
|
|
word = word + "s" |
|
|
|
|
|
|
|
return f"{len(teams)} {word}" |
|
|
|
else: |
|
|
|
else: |
|
|
|
return None |
|
|
|
return None |
|
|
|
|
|
|
|
|
|
|
|
|