kpsul/gestioncof/cms/views.py

16 lines
611 B
Python
Raw Normal View History

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