From d14ec486020716b4bce995a14beb508b550e4993 Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Fri, 10 Sep 2021 22:03:52 +0200 Subject: [PATCH] support POST request on ScoDoc7-compat API routes --- app/views/absences.py | 8 +++++--- app/views/notes.py | 12 +++++++++--- app/views/scolar.py | 14 ++++++++++---- 3 files changed, 24 insertions(+), 10 deletions(-) diff --git a/app/views/absences.py b/app/views/absences.py index 6c84fec8f..294856bd0 100644 --- a/app/views/absences.py +++ b/app/views/absences.py @@ -1235,7 +1235,9 @@ def listeBilletsEtud(etudid=False, REQUEST=None, format="html"): return tab.make_page(REQUEST=REQUEST, format=format) -@bp.route("/XMLgetBilletsEtud") +@bp.route( + "/XMLgetBilletsEtud", methods=["GET", "POST"] +) # pour compat anciens clients PHP @scodoc @permission_required_compat_scodoc7(Permission.ScoView) @scodoc7func @@ -1249,7 +1251,7 @@ def XMLgetBilletsEtud(etudid=False, REQUEST=None): return r -@bp.route("/listeBillets") +@bp.route("/listeBillets", methods=["GET", "POST"]) # pour compat anciens clients PHP @scodoc @permission_required_compat_scodoc7(Permission.ScoView) @scodoc7func @@ -1470,7 +1472,7 @@ def ProcessBilletAbsenceForm(billet_id, REQUEST=None): # return "OK OK x=" + str(x) -@bp.route("/XMLgetAbsEtud") +@bp.route("/XMLgetAbsEtud", methods=["GET", "POST"]) # pour compat anciens clients PHP @scodoc @permission_required_compat_scodoc7(Permission.ScoView) @scodoc7func diff --git a/app/views/notes.py b/app/views/notes.py index 67f58dd80..77eea51ef 100644 --- a/app/views/notes.py +++ b/app/views/notes.py @@ -255,7 +255,9 @@ sco_publish( ) -@bp.route("formsemestre_bulletinetud") +@bp.route( + "formsemestre_bulletinetud", methods=["GET", "POST"] +) # pour compat anciens clients PHP @scodoc @permission_required_compat_scodoc7(Permission.ScoView) @scodoc7func @@ -597,7 +599,9 @@ sco_publish("/ue_move", sco_edit_formation.ue_move, Permission.ScoChangeFormatio # --- Semestres de formation -@bp.route("/formsemestre_list") +@bp.route( + "/formsemestre_list", methods=["GET", "POST"] +) # pour compat anciens clients PHP @scodoc @permission_required_compat_scodoc7(Permission.ScoView) @scodoc7func @@ -623,7 +627,9 @@ def formsemestre_list( return scu.sendResult(REQUEST, sems, name="formsemestre", format=format) -@bp.route("/XMLgetFormsemestres") +@bp.route( + "/XMLgetFormsemestres", methods=["GET", "POST"] +) # pour compat anciens clients PHP @scodoc @permission_required_compat_scodoc7(Permission.ScoView) @scodoc7func diff --git a/app/views/scolar.py b/app/views/scolar.py index 145208cdb..f05b77482 100644 --- a/app/views/scolar.py +++ b/app/views/scolar.py @@ -400,10 +400,16 @@ def search_etud_by_name(): # XMLgetEtudInfos était le nom dans l'ancienne API ScoDoc 6 -@bp.route("/etud_info") -@bp.route("/XMLgetEtudInfos") -@bp.route("/Absences/XMLgetEtudInfos") # compat with OLD clients -@bp.route("/Notes/XMLgetEtudInfos") +@bp.route("/etud_info", methods=["GET", "POST"]) # pour compat anciens clients PHP) +@bp.route( + "/XMLgetEtudInfos", methods=["GET", "POST"] +) # pour compat anciens clients PHP) +@bp.route( + "/Absences/XMLgetEtudInfos", methods=["GET", "POST"] +) # pour compat anciens clients PHP +@bp.route( + "/Notes/XMLgetEtudInfos", methods=["GET", "POST"] +) # pour compat anciens clients PHP @scodoc @permission_required_compat_scodoc7(Permission.ScoView) @scodoc7func