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)
# Block iframe
class IFrameBlock(blocks.StructBlock):
url = blocks.URLBlock("Adresse de la page")

View file

@ -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})