diff --git a/apps/tournament/models.py b/apps/tournament/models.py index 2c8095a..c542590 100644 --- a/apps/tournament/models.py +++ b/apps/tournament/models.py @@ -79,6 +79,10 @@ class Tournament(models.Model): verbose_name=_("year"), ) + @property + def teams(self): + return self._teams if not self.final else Team.objects.filter(selected_for_final=True) + @property def linked_organizers(self): return [''.format(url=reverse_lazy("member:information", args=(user.pk,))) + str(user) + '' @@ -122,7 +126,7 @@ class Team(models.Model): tournament = models.ForeignKey( Tournament, on_delete=models.PROTECT, - related_name="teams", + related_name="_teams", verbose_name=_("tournament"), )