Fix permission to view user detail
This commit is contained in:
parent
55c3a5fcc8
commit
a6000aec2a
|
@ -242,7 +242,7 @@ class UserDetailView(LoginRequiredMixin, DetailView):
|
||||||
user = self.get_object()
|
user = self.get_object()
|
||||||
if user == me or me.registration.is_admin or me.registration.is_volunteer \
|
if user == me or me.registration.is_admin or me.registration.is_volunteer \
|
||||||
and user.registration.participates and user.registration.team \
|
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 \
|
or user.registration.is_volunteer and me.registration.is_volunteer \
|
||||||
and me.registration.interesting_tournaments.intersection(user.registration.intersting_tournaments):
|
and me.registration.interesting_tournaments.intersection(user.registration.intersting_tournaments):
|
||||||
return super().dispatch(request, *args, **kwargs)
|
return super().dispatch(request, *args, **kwargs)
|
||||||
|
|
Loading…
Reference in New Issue