Syntheses are working

This commit is contained in:
Yohann D'ANELLO 2020-05-20 15:50:44 +02:00
parent 495f42e594
commit 70f391420c
1 changed files with 4 additions and 2 deletions

View File

@ -538,10 +538,12 @@ class SynthesesOrgaListView(OrgaMixin, SingleTableView):
qs = super().get_queryset()
if not self.request.user.admin:
if self.request.user in Tournament.get_final().organizers.all():
qs = qs.filter(Q(team__tournament__organizers=self.request.user) | Q(pools__juries=self.request.user)
qs = qs.filter(Q(team__tournament__organizers=self.request.user)
| Q(team__pools__juries=self.request.user)
| Q(final=True))
else:
qs = qs.filter(Q(team__tournament__organizers=self.request.user) | Q(pools__juries=self.request.user))
qs = qs.filter(Q(team__tournament__organizers=self.request.user)
| Q(team__pools__juries=self.request.user))
return qs.order_by('final', 'team__tournament__date_start', 'team__tournament__name', 'team__trigram',
'round', 'source',).distinct()