aboutsummaryrefslogtreecommitdiff
path: root/views.py
diff options
context:
space:
mode:
Diffstat (limited to 'views.py')
-rw-r--r--views.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/views.py b/views.py
index e45ece3..de38f35 100644
--- a/views.py
+++ b/views.py
@@ -259,6 +259,8 @@ def room_timetable(request, room_slug, year=None, week=None):
@csrf_exempt
def qsjps(request):
+ status = 200
+
if request.method == "POST":
# Si on traite un formulaire, on le valide
form = QSJPSForm(request.POST)
@@ -278,12 +280,13 @@ def qsjps(request):
# Si le formulaire est invalide, on ré-affiche le formulaire
# avec les erreurs
+ status = 400
else:
# Si le formulaire n’a pas été soumis, on en instancie un
# nouveau
form = QSJPSForm()
- return render(request, "qsjps_form.html", {"form": form})
+ return render(request, "qsjps_form.html", {"form": form}, status=status)
def ctx_processor(request):