Fix linting issues

This commit is contained in:
Martin Pépin 2020-08-25 19:20:37 +02:00
parent 2cf0ccbb6b
commit 5989f65154
No known key found for this signature in database
GPG key ID: E7520278B1774448
2 changed files with 12 additions and 5 deletions

View file

@ -49,6 +49,7 @@ class COFRootPage(RoutablePageMixin, Page, COFActuIndexMixin):
return sympa_captcha_form_view(request) return sympa_captcha_form_view(request)
# Block iframe # Block iframe
class IFrameBlock(blocks.StructBlock): class IFrameBlock(blocks.StructBlock):
url = blocks.URLBlock("Adresse de la page") url = blocks.URLBlock("Adresse de la page")

View file

@ -1,12 +1,14 @@
import re
from django import forms from django import forms
from django.shortcuts import render, redirect from django.shortcuts import render
from django.utils.translation import gettext as _ from django.utils.translation import gettext as _
import re
def raw_calendar_view(request, year, month): def raw_calendar_view(request, year, month):
return render(request, "cofcms/calendar_raw.html", {"month": month, "year": year}) return render(request, "cofcms/calendar_raw.html", {"month": month, "year": year})
class CaptchaForm(forms.Form): class CaptchaForm(forms.Form):
answer = forms.CharField(label="Réponse", max_length=32) answer = forms.CharField(label="Réponse", max_length=32)
@ -17,12 +19,16 @@ class CaptchaForm(forms.Form):
return value return value
def sympa_captcha_form_view(request): def sympa_captcha_form_view(request):
if request.method == "POST": if request.method == "POST":
form = CaptchaForm(request.POST) form = CaptchaForm(request.POST)
if form.is_valid(): if form.is_valid():
return render(request, "cofcms/sympa.html", return render(
{"redirect": "https://lists.ens.fr/wws/lists/"}) request,
"cofcms/sympa.html",
{"redirect": "https://lists.ens.fr/wws/lists/"},
)
else: else:
form = CaptchaForm() form = CaptchaForm()