1
0
mirror of https://gitlab.com/animath/si/plateforme.git synced 2025-02-25 21:06:30 +00:00

Compare commits

..

No commits in common. "99f4aed360aeb43caeac6d3defd36c6994730ef4" and "62ab0a4c477dd9176f39306b62c8cb24abb7541f" have entirely different histories.

View File

@ -16,7 +16,7 @@ from django.http import FileResponse, Http404
from django.shortcuts import redirect, resolve_url
from django.template.loader import render_to_string
from django.urls import reverse_lazy
from django.utils import timezone, translation
from django.utils import timezone
from django.utils.crypto import get_random_string
from django.utils.http import urlsafe_base64_decode
from django.utils.translation import gettext_lazy as _
@ -390,8 +390,6 @@ class AuthorizationTemplateView(TemplateView):
def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
translation.activate("fr")
if "registration_id" in self.request.GET:
registration = Registration.objects.get(pk=self.request.GET.get("registration_id"))
# Don't get unwanted information
@ -402,10 +400,6 @@ 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.")