1
0
mirror of https://gitlab.com/animath/si/plateforme.git synced 2025-06-26 03:57:41 +02:00

Final organizers can see the team information

This commit is contained in:
Yohann D'ANELLO
2020-05-18 23:51:13 +02:00
parent be1957d984
commit 7c89aa62cc
2 changed files with 4 additions and 2 deletions

View File

@ -156,6 +156,8 @@ class TeamDetailView(LoginRequiredMixin, DetailView):
"""
if not request.user.is_authenticated or \
(not request.user.admin and self.request.user not in self.get_object().tournament.organizers.all()
and not (self.get_object().selected_for_final
and request.user in Tournament.get_final().organizers.all())
and self.get_object() != request.user.team):
raise PermissionDenied
return super().dispatch(request, *args, **kwargs)