forked from DGNum/gestioCOF
Fix linting issues
This commit is contained in:
parent
2cf0ccbb6b
commit
5989f65154
2 changed files with 12 additions and 5 deletions
|
@ -49,6 +49,7 @@ class COFRootPage(RoutablePageMixin, Page, COFActuIndexMixin):
|
|||
|
||||
return sympa_captcha_form_view(request)
|
||||
|
||||
|
||||
# Block iframe
|
||||
class IFrameBlock(blocks.StructBlock):
|
||||
url = blocks.URLBlock("Adresse de la page")
|
||||
|
|
|
@ -1,12 +1,14 @@
|
|||
import re
|
||||
|
||||
from django import forms
|
||||
from django.shortcuts import render, redirect
|
||||
from django.shortcuts import render
|
||||
from django.utils.translation import gettext as _
|
||||
|
||||
import re
|
||||
|
||||
def raw_calendar_view(request, year, month):
|
||||
return render(request, "cofcms/calendar_raw.html", {"month": month, "year": year})
|
||||
|
||||
|
||||
class CaptchaForm(forms.Form):
|
||||
answer = forms.CharField(label="Réponse", max_length=32)
|
||||
|
||||
|
@ -17,13 +19,17 @@ class CaptchaForm(forms.Form):
|
|||
|
||||
return value
|
||||
|
||||
|
||||
def sympa_captcha_form_view(request):
|
||||
if request.method == "POST":
|
||||
form = CaptchaForm(request.POST)
|
||||
if form.is_valid():
|
||||
return render(request, "cofcms/sympa.html",
|
||||
{"redirect": "https://lists.ens.fr/wws/lists/"})
|
||||
return render(
|
||||
request,
|
||||
"cofcms/sympa.html",
|
||||
{"redirect": "https://lists.ens.fr/wws/lists/"},
|
||||
)
|
||||
else:
|
||||
form = CaptchaForm()
|
||||
|
||||
|
||||
return render(request, "cofcms/sympa.html", {"form": form})
|
||||
|
|
Loading…
Reference in a new issue