Payments in the list for a tournament are distinct

Signed-off-by: Emmy D'Anello <emmy.danello@animath.fr>
This commit is contained in:
Emmy D'Anello 2024-03-16 10:40:56 +01:00
parent afbc67c413
commit 12d25b64fe
Signed by: ynerant
GPG Key ID: 3A75C55819C8CF85
1 changed files with 2 additions and 1 deletions

View File

@ -590,7 +590,8 @@ class TournamentPaymentsView(VolunteerMixin, SingleTableMixin, DetailView):
def get_table_data(self): def get_table_data(self):
return Payment.objects.filter(registrations__team__participation__tournament=self.get_object()) \ return Payment.objects.filter(registrations__team__participation__tournament=self.get_object()) \
.annotate(team_id=F('registrations__team')).order_by('-valid', 'registrations__team__trigram').all() .annotate(team_id=F('registrations__team')).order_by('-valid', 'registrations__team__trigram') \
.distinct().all()
class TournamentExportCSVView(VolunteerMixin, DetailView): class TournamentExportCSVView(VolunteerMixin, DetailView):