1
0
mirror of https://gitlab.com/animath/si/plateforme.git synced 2024-12-25 06:22:22 +00:00

Fix permission to view user detail

This commit is contained in:
Yohann D'ANELLO 2021-01-29 10:24:00 +01:00
parent 55c3a5fcc8
commit a6000aec2a
Signed by: ynerant
GPG Key ID: 3A75C55819C8CF85

View File

@ -242,7 +242,7 @@ class UserDetailView(LoginRequiredMixin, DetailView):
user = self.get_object()
if user == me or me.registration.is_admin or me.registration.is_volunteer \
and user.registration.participates and user.registration.team \
and user.registration.team.participation.tournament in user.registration.organized_tournaments.all() \
and user.registration.team.participation.tournament in me.registration.organized_tournaments.all() \
or user.registration.is_volunteer and me.registration.is_volunteer \
and me.registration.interesting_tournaments.intersection(user.registration.intersting_tournaments):
return super().dispatch(request, *args, **kwargs)