2017-08-07 23:31:27 +02:00
|
|
|
from django.shortcuts import render
|
2018-01-28 23:44:48 +01:00
|
|
|
from django.http.response import HttpResponseRedirect
|
|
|
|
import re
|
2017-08-07 23:31:27 +02:00
|
|
|
|
2018-01-28 23:44:48 +01:00
|
|
|
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})
|