mirror of
https://gitlab.com/animath/si/plateforme-corres2math.git
synced 2025-08-21 09:28:41 +02:00
Don't access to team participation if the team is not validated
This commit is contained in:
@@ -170,6 +170,8 @@ class ParticipationDetailView(LoginRequiredMixin, DetailView):
|
||||
|
||||
def dispatch(self, request, *args, **kwargs):
|
||||
user = request.user
|
||||
if not self.get_object().valid:
|
||||
raise PermissionDenied(_("The team is not validated yet."))
|
||||
if user.registration.is_admin or user.registration.participates\
|
||||
and user.registration.team.participation.pk == kwargs["pk"]:
|
||||
return super().dispatch(request, *args, **kwargs)
|
||||
|
Reference in New Issue
Block a user