diff --git a/registration/views.py b/registration/views.py index a7bd048..be5c24a 100644 --- a/registration/views.py +++ b/registration/views.py @@ -400,6 +400,10 @@ class AuthorizationTemplateView(TemplateView): if not Tournament.objects.filter(pk=self.request.GET.get("tournament_id")).exists(): raise PermissionDenied("Ce tournoi n'existe pas.") context["tournament"] = Tournament.objects.get(pk=self.request.GET.get("tournament_id")) + elif "tournament_name" in self.request.GET: + if not Tournament.objects.filter(name__iexact=self.request.GET.get("tournament_name")).exists(): + raise PermissionDenied("Ce tournoi n'existe pas.") + context["tournament"] = Tournament.objects.get(name__iexact=self.request.GET.get("tournament_name")) else: raise PermissionDenied("Merci d'indiquer un tournoi.")