From 7a004596ca8680e772c1b602e2e10673eace909d Mon Sep 17 00:00:00 2001 From: Emmy D'Anello Date: Sun, 7 Apr 2024 12:09:31 +0200 Subject: [PATCH] Only display final selection after publishing results Signed-off-by: Emmy D'Anello --- participation/templates/participation/tournament_detail.html | 4 ++-- participation/views.py | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/participation/templates/participation/tournament_detail.html b/participation/templates/participation/tournament_detail.html index 0fc8535..e889bc2 100644 --- a/participation/templates/participation/tournament_detail.html +++ b/participation/templates/participation/tournament_detail.html @@ -106,7 +106,7 @@
  • {{ participation.team }} : {{ note|floatformat }} {% if participation.final %} - + {% trans "Selected for final tournament" %} @@ -114,7 +114,7 @@ {% if user.registration.is_admin or user.registration in tournament.organizers.all %} {% if team_selectable_for_final == participation %} + class="badge badge-sm text-bg-success"> {% trans "Select for final tournament" %} diff --git a/participation/views.py b/participation/views.py index cdbe1c4..db3b595 100644 --- a/participation/views.py +++ b/participation/views.py @@ -621,7 +621,8 @@ class TournamentDetailView(MultiTableMixin, DetailView): context["available_notes_1"] = all(pool.results_available for pool in self.object.pools.filter(round=1).all()) context["available_notes_2"] = all(pool.results_available for pool in self.object.pools.filter(round=2).all()) - if not self.object.final and notes and self.request.user.registration.is_volunteer: + if not self.object.final and notes and context["available_notes_2"] \ + and self.request.user.registration.is_volunteer: context["team_selectable_for_final"] = next(participation for participation, _note in sorted_notes if not participation.final)