mirror of
https://gitlab.com/animath/si/plateforme.git
synced 2024-12-25 06:22:22 +00:00
Display scores of all teams in a 5-teams pool
Signed-off-by: Emmy D'Anello <emmy.danello@animath.fr>
This commit is contained in:
parent
bacdd5cfcf
commit
f457a2355e
@ -936,7 +936,10 @@ class PoolDetailView(LoginRequiredMixin, DetailView):
|
|||||||
# Hide notes before the end of the turn
|
# Hide notes before the end of the turn
|
||||||
notes = dict()
|
notes = dict()
|
||||||
for participation in self.object.participations.all():
|
for participation in self.object.participations.all():
|
||||||
note = self.object.average(participation)
|
# For a 5-teams pool, notes are separated in 2 different pool objects, so we fetch them all
|
||||||
|
all_pools = self.object.tournament.pools.filter(round=self.object.round,
|
||||||
|
letter=self.object.letter).all()
|
||||||
|
note = sum(pool.average(participation) for pool in all_pools)
|
||||||
if note:
|
if note:
|
||||||
notes[participation] = note
|
notes[participation] = note
|
||||||
context["notes"] = sorted(notes.items(), key=lambda x: x[1], reverse=True)
|
context["notes"] = sorted(notes.items(), key=lambda x: x[1], reverse=True)
|
||||||
|
Loading…
Reference in New Issue
Block a user