aboutsummaryrefslogtreecommitdiff
path: root/views.py
diff options
context:
space:
mode:
authorAlban Gruin2018-09-29 17:02:43 +0200
committerAlban Gruin2018-09-29 17:02:43 +0200
commitfc1fc472931cae0ba3d0a0103c328f85b7b52586 (patch)
treef6be7fb6463ff29f26de8db5386729a4fc9f975b /views.py
parenta4000b40682c93efacec31308dce4a32eeac7ef7 (diff)
parentc95740a4d97fc579f4f12a6abf01eac446fde1cc (diff)
Merge branch 'stable/0.14.z' into prod/pa1ch/0.14.zv0.14.2-pa1ch
Signed-off-by: Alban Gruin <alban at pa1ch dot fr>
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):