mirror of
https://gitlab.com/animath/si/plateforme-corres2math.git
synced 2025-08-21 09:28:41 +02:00
Test leave team
This commit is contained in:
@@ -316,7 +316,7 @@ class TeamLeaveView(LoginRequiredMixin, TemplateView):
|
||||
def dispatch(self, request, *args, **kwargs):
|
||||
if not request.user.is_authenticated:
|
||||
return self.handle_no_permission()
|
||||
if not request.user.registration.team:
|
||||
if not request.user.registration.participates or not request.user.registration.team:
|
||||
raise PermissionDenied(_("You are not in a team."))
|
||||
if request.user.registration.team.participation.valid is not None:
|
||||
raise PermissionDenied(_("The team is already validated or the validation is pending."))
|
||||
|
Reference in New Issue
Block a user