diff --git a/tournaments/models/club.py b/tournaments/models/club.py index 4614836..10f848f 100644 --- a/tournaments/models/club.py +++ b/tournaments/models/club.py @@ -26,6 +26,6 @@ class Club(models.Model): def court_name(self, index): for court in self.court_set.all(): - if court.index == index and court.name: + if court.index == index and court.name is not None and len(court.name) > 0: return court.name - return f"Terrain {index}" + return f"Terrain {index + 1}" diff --git a/tournaments/models/court.py b/tournaments/models/court.py index d0b4de0..e8df8a7 100644 --- a/tournaments/models/court.py +++ b/tournaments/models/court.py @@ -14,4 +14,4 @@ class Court(models.Model): if self.name: return self.name else: - return f"Terrain {self.index}" + return f"Terrain {self.index + 1}"