From 6d1ffb122b0e6e2905d647c163745e3e4ab673d2 Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Fri, 24 Sep 2021 01:07:00 +0200 Subject: [PATCH] Fix: billets d'absences (POST) --- app/scodoc/sco_abs.py | 1 - app/views/absences.py | 14 ++++---------- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/app/scodoc/sco_abs.py b/app/scodoc/sco_abs.py index 39d075bb1..be823d336 100644 --- a/app/scodoc/sco_abs.py +++ b/app/scodoc/sco_abs.py @@ -626,7 +626,6 @@ def add_absence( jour, matin, estjust, - REQUEST, description=None, moduleimpl_id=None, ): diff --git a/app/views/absences.py b/app/views/absences.py index 1a1134440..297e642a6 100644 --- a/app/views/absences.py +++ b/app/views/absences.py @@ -1282,7 +1282,7 @@ def listeBillets(REQUEST=None): ) -@bp.route("/deleteBilletAbsence") +@bp.route("/deleteBilletAbsence", methods=["POST", "GET"]) @scodoc @permission_required(Permission.ScoAbsChange) @scodoc7func @@ -1308,7 +1308,7 @@ def deleteBilletAbsence(billet_id, REQUEST=None, dialog_confirmed=False): return flask.redirect("listeBillets?head_message=Billet%20supprimé") -def _ProcessBilletAbsence(billet, estjust, description, REQUEST): +def _ProcessBilletAbsence(billet, estjust, description): """Traite un billet: ajoute absence(s) et éventuellement justificatifs, et change l'état du billet à 1. NB: actuellement, les heures ne sont utilisées que pour déterminer si matin et/ou après-midi. @@ -1330,7 +1330,6 @@ def _ProcessBilletAbsence(billet, estjust, description, REQUEST): dates[0], 0, estjust, - REQUEST, description=description, ) n += 1 @@ -1342,7 +1341,6 @@ def _ProcessBilletAbsence(billet, estjust, description, REQUEST): dates[-1], 1, estjust, - REQUEST, description=description, ) n += 1 @@ -1354,7 +1352,6 @@ def _ProcessBilletAbsence(billet, estjust, description, REQUEST): jour, 0, estjust, - REQUEST, description=description, ) sco_abs.add_absence( @@ -1362,7 +1359,6 @@ def _ProcessBilletAbsence(billet, estjust, description, REQUEST): jour, 1, estjust, - REQUEST, description=description, ) n += 2 @@ -1373,7 +1369,7 @@ def _ProcessBilletAbsence(billet, estjust, description, REQUEST): return n -@bp.route("/ProcessBilletAbsenceForm") +@bp.route("/ProcessBilletAbsenceForm", methods=["POST", "GET"]) @scodoc @permission_required(Permission.ScoAbsChange) @scodoc7func @@ -1440,9 +1436,7 @@ def ProcessBilletAbsenceForm(billet_id, REQUEST=None): elif tf[0] == -1: return flask.redirect(scu.ScoURL()) else: - n = _ProcessBilletAbsence( - billet, tf[2]["estjust"], tf[2]["description"], REQUEST - ) + n = _ProcessBilletAbsence(billet, tf[2]["estjust"], tf[2]["description"]) if tf[2]["estjust"]: j = "justifiées" else: