1
0
mirror of https://gitlab.com/animath/si/plateforme.git synced 2024-12-25 05:42:23 +00:00

Fix error message when a tournament is not specified

This commit is contained in:
Yohann D'ANELLO 2021-01-29 10:31:30 +01:00
parent a6000aec2a
commit 67540df334
Signed by: ynerant
GPG Key ID: 3A75C55819C8CF85

View File

@ -376,10 +376,10 @@ class AuthorizationTemplateView(TemplateView):
if registration.user == self.request.user \
or self.request.user.is_authenticated and self.request.user.registration.is_admin:
context["registration"] = registration
if "tournament_id" in self.request.GET:
if "tournament_id" in self.request.GET and self.request.GET.get("tournament_id"):
context["tournament"] = Tournament.objects.get(pk=self.request.GET.get("tournament_id"))
else:
raise ValueError("Merci d'indiquer un tournoi.")
raise PermissionDenied("Merci d'indiquer un tournoi.")
return context