diff options
-rw-r--r-- | views.py | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -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): |