From 67540df3346d6ad71b118218ef637828785ca88d Mon Sep 17 00:00:00 2001 From: Yohann D'ANELLO Date: Fri, 29 Jan 2021 10:31:30 +0100 Subject: [PATCH] Fix error message when a tournament is not specified --- apps/registration/views.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/registration/views.py b/apps/registration/views.py index 6997c93..a938ede 100644 --- a/apps/registration/views.py +++ b/apps/registration/views.py @@ -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