mirror of
https://gitlab.com/animath/si/plateforme.git
synced 2025-07-05 05:04:04 +02:00
Don't display notes too early
This commit is contained in:
@ -466,8 +466,10 @@ class TournamentDetailView(DetailView):
|
||||
|
||||
notes = dict()
|
||||
for participation in self.object.participations.all():
|
||||
notes[participation] = sum(pool.average(participation)
|
||||
for pool in self.object.pools.filter(participations=participation).all())
|
||||
note = sum(pool.average(participation)
|
||||
for pool in self.object.pools.filter(participations=participation).all())
|
||||
if note:
|
||||
notes[participation] = note
|
||||
context["notes"] = sorted(notes.items(), key=lambda x: x[1], reverse=True)
|
||||
|
||||
return context
|
||||
@ -536,7 +538,9 @@ class PoolDetailView(LoginRequiredMixin, DetailView):
|
||||
|
||||
notes = dict()
|
||||
for participation in self.object.participations.all():
|
||||
notes[participation] = self.object.average(participation)
|
||||
note = self.object.average(participation)
|
||||
if note:
|
||||
notes[participation] = note
|
||||
context["notes"] = sorted(notes.items(), key=lambda x: x[1], reverse=True)
|
||||
|
||||
return context
|
||||
|
Reference in New Issue
Block a user