from django.shortcuts import render from django.http.response import HttpResponseRedirect import re def raw_calendar_view(request, year, month): return render(request, "cofcms/calendar_raw.html", {"month": month, "year": year}) def sympa_view(request): erreur = None if request.POST and "bassin" in request.POST: if re.match(r'\s*(les|the)\s*ernests?\s*', request.POST["bassin"], re.IGNORECASE): return HttpResponseRedirect("https://lists.ens.fr/wws") erreur = "RĂ©ponse invalide" return render(request, "cofcms/sympa.html", {"erreur": erreur})