From a6000aec2a291d723171cbf56449b6a9369d7cea Mon Sep 17 00:00:00 2001 From: Yohann D'ANELLO Date: Fri, 29 Jan 2021 10:24:00 +0100 Subject: [PATCH] Fix permission to view user detail --- apps/registration/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/registration/views.py b/apps/registration/views.py index 00a3616..6997c93 100644 --- a/apps/registration/views.py +++ b/apps/registration/views.py @@ -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)