1
0
mirror of https://gitlab.com/animath/si/plateforme.git synced 2025-07-03 02:42:53 +02:00

Auto select the single tournament for ETEAM

Signed-off-by: Emmy D'Anello <emmy.danello@animath.fr>
This commit is contained in:
Emmy D'Anello
2024-06-07 17:24:24 +02:00
parent e026f49f8d
commit 73ea3d1717
4 changed files with 118 additions and 0 deletions

View File

@ -436,6 +436,9 @@ class AuthorizationTemplateView(TemplateView):
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"))
elif settings.TFJM_APP == "ETEAM":
# One single tournament
context["tournament"] = Tournament.objects.first()
else:
raise PermissionDenied("Merci d'indiquer un tournoi.")