mirror of
https://gitlab.com/animath/si/plateforme-corres2math.git
synced 2025-02-06 12:53:03 +00:00
user.is_admin -> user.registration.is_admin
This commit is contained in:
parent
88c4a6b218
commit
0dece5abef
@ -82,7 +82,7 @@ class TeamDetailView(LoginRequiredMixin, DetailView):
|
|||||||
|
|
||||||
def dispatch(self, request, *args, **kwargs):
|
def dispatch(self, request, *args, **kwargs):
|
||||||
user = request.user
|
user = request.user
|
||||||
if user.is_admin or user.registration.participates and user.registration.team.pk == kwargs["pk"]:
|
if user.registration.is_admin or user.registration.participates and user.registration.team.pk == kwargs["pk"]:
|
||||||
return super().dispatch(request, *args, **kwargs)
|
return super().dispatch(request, *args, **kwargs)
|
||||||
raise PermissionDenied
|
raise PermissionDenied
|
||||||
|
|
||||||
@ -94,7 +94,7 @@ class TeamUpdateView(LoginRequiredMixin, UpdateView):
|
|||||||
|
|
||||||
def dispatch(self, request, *args, **kwargs):
|
def dispatch(self, request, *args, **kwargs):
|
||||||
user = request.user
|
user = request.user
|
||||||
if user.is_admin or user.registration.participates and user.registration.team.pk == kwargs["pk"]:
|
if user.registration.is_admin or user.registration.participates and user.registration.team.pk == kwargs["pk"]:
|
||||||
return super().dispatch(request, *args, **kwargs)
|
return super().dispatch(request, *args, **kwargs)
|
||||||
raise PermissionDenied
|
raise PermissionDenied
|
||||||
|
|
||||||
@ -133,7 +133,8 @@ class ParticipationDetailView(LoginRequiredMixin, DetailView):
|
|||||||
|
|
||||||
def dispatch(self, request, *args, **kwargs):
|
def dispatch(self, request, *args, **kwargs):
|
||||||
user = request.user
|
user = request.user
|
||||||
if user.is_admin or user.registration.participates and user.registration.team.participation.pk == kwargs["pk"]:
|
if user.registration.is_admin or user.registration.participates\
|
||||||
|
and user.registration.team.participation.pk == kwargs["pk"]:
|
||||||
return super().dispatch(request, *args, **kwargs)
|
return super().dispatch(request, *args, **kwargs)
|
||||||
raise PermissionDenied
|
raise PermissionDenied
|
||||||
|
|
||||||
@ -145,7 +146,7 @@ class UploadVideoView(LoginRequiredMixin, UpdateView):
|
|||||||
|
|
||||||
def dispatch(self, request, *args, **kwargs):
|
def dispatch(self, request, *args, **kwargs):
|
||||||
user = request.user
|
user = request.user
|
||||||
if user.is_admin or user.registration.participates\
|
if user.registration.is_admin or user.registration.participates\
|
||||||
and user.registration.team.participation.pk == self.object.participation.pk:
|
and user.registration.team.participation.pk == self.object.participation.pk:
|
||||||
return super().dispatch(request, *args, **kwargs)
|
return super().dispatch(request, *args, **kwargs)
|
||||||
raise PermissionDenied
|
raise PermissionDenied
|
||||||
|
Loading…
x
Reference in New Issue
Block a user