From 18cfd383d8da0a639cf8234a16da8737a98dced8 Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Wed, 11 Oct 2023 16:37:13 +0200 Subject: [PATCH] Assiduite: API routes: fix etudid: int type. Fix #773. --- app/api/assiduites.py | 44 ++++++++++++++++++++++------------------ app/api/justificatifs.py | 22 +++++++++++--------- 2 files changed, 36 insertions(+), 30 deletions(-) diff --git a/app/api/assiduites.py b/app/api/assiduites.py index b3ed9a58..a9451ae7 100644 --- a/app/api/assiduites.py +++ b/app/api/assiduites.py @@ -84,15 +84,17 @@ def assiduite_justificatifs(assiduite_id: int = None, long: bool = False): # etudid -@bp.route("/assiduites//count", defaults={"with_query": False}) -@api_web_bp.route("/assiduites//count", defaults={"with_query": False}) -@bp.route("/assiduites//count/query", defaults={"with_query": True}) -@api_web_bp.route("/assiduites//count/query", defaults={"with_query": True}) -@bp.route("/assiduites/etudid//count", defaults={"with_query": False}) -@api_web_bp.route("/assiduites/etudid//count", defaults={"with_query": False}) -@bp.route("/assiduites/etudid//count/query", defaults={"with_query": True}) +@bp.route("/assiduites//count", defaults={"with_query": False}) +@api_web_bp.route("/assiduites//count", defaults={"with_query": False}) +@bp.route("/assiduites//count/query", defaults={"with_query": True}) +@api_web_bp.route("/assiduites//count/query", defaults={"with_query": True}) +@bp.route("/assiduites/etudid//count", defaults={"with_query": False}) @api_web_bp.route( - "/assiduites/etudid//count/query", defaults={"with_query": True} + "/assiduites/etudid//count", defaults={"with_query": False} +) +@bp.route("/assiduites/etudid//count/query", defaults={"with_query": True}) +@api_web_bp.route( + "/assiduites/etudid//count/query", defaults={"with_query": True} ) # nip @bp.route("/assiduites/nip//count", defaults={"with_query": False}) @@ -183,14 +185,16 @@ def count_assiduites( # etudid -@bp.route("/assiduites/", defaults={"with_query": False}) -@api_web_bp.route("/assiduites/", defaults={"with_query": False}) -@bp.route("/assiduites//query", defaults={"with_query": True}) -@api_web_bp.route("/assiduites//query", defaults={"with_query": True}) -@bp.route("/assiduites/etudid/", defaults={"with_query": False}) -@api_web_bp.route("/assiduites/etudid/", defaults={"with_query": False}) -@bp.route("/assiduites/etudid//query", defaults={"with_query": True}) -@api_web_bp.route("/assiduites/etudid//query", defaults={"with_query": True}) +@bp.route("/assiduites/", defaults={"with_query": False}) +@api_web_bp.route("/assiduites/", defaults={"with_query": False}) +@bp.route("/assiduites//query", defaults={"with_query": True}) +@api_web_bp.route("/assiduites//query", defaults={"with_query": True}) +@bp.route("/assiduites/etudid/", defaults={"with_query": False}) +@api_web_bp.route("/assiduites/etudid/", defaults={"with_query": False}) +@bp.route("/assiduites/etudid//query", defaults={"with_query": True}) +@api_web_bp.route( + "/assiduites/etudid//query", defaults={"with_query": True} +) # nip @bp.route("/assiduites/nip/", defaults={"with_query": False}) @api_web_bp.route("/assiduites/nip/", defaults={"with_query": False}) @@ -437,10 +441,10 @@ def count_assiduites_formsemestre( # etudid -@bp.route("/assiduite//create", methods=["POST"]) -@api_web_bp.route("/assiduite//create", methods=["POST"]) -@bp.route("/assiduite/etudid//create", methods=["POST"]) -@api_web_bp.route("/assiduite/etudid//create", methods=["POST"]) +@bp.route("/assiduite//create", methods=["POST"]) +@api_web_bp.route("/assiduite//create", methods=["POST"]) +@bp.route("/assiduite/etudid//create", methods=["POST"]) +@api_web_bp.route("/assiduite/etudid//create", methods=["POST"]) # nip @bp.route("/assiduite/nip//create", methods=["POST"]) @api_web_bp.route("/assiduite/nip//create", methods=["POST"]) diff --git a/app/api/justificatifs.py b/app/api/justificatifs.py index f5b804bb..e8893388 100644 --- a/app/api/justificatifs.py +++ b/app/api/justificatifs.py @@ -63,14 +63,16 @@ def justificatif(justif_id: int = None): # etudid -@bp.route("/justificatifs/", defaults={"with_query": False}) -@api_web_bp.route("/justificatifs/", defaults={"with_query": False}) -@bp.route("/justificatifs//query", defaults={"with_query": True}) -@api_web_bp.route("/justificatifs//query", defaults={"with_query": True}) -@bp.route("/justificatifs/etudid/", defaults={"with_query": False}) -@api_web_bp.route("/justificatifs/etudid/", defaults={"with_query": False}) -@bp.route("/justificatifs/etudid//query", defaults={"with_query": True}) -@api_web_bp.route("/justificatifs/etudid//query", defaults={"with_query": True}) +@bp.route("/justificatifs/", defaults={"with_query": False}) +@api_web_bp.route("/justificatifs/", defaults={"with_query": False}) +@bp.route("/justificatifs//query", defaults={"with_query": True}) +@api_web_bp.route("/justificatifs//query", defaults={"with_query": True}) +@bp.route("/justificatifs/etudid/", defaults={"with_query": False}) +@api_web_bp.route("/justificatifs/etudid/", defaults={"with_query": False}) +@bp.route("/justificatifs/etudid//query", defaults={"with_query": True}) +@api_web_bp.route( + "/justificatifs/etudid//query", defaults={"with_query": True} +) # nip @bp.route("/justificatifs/nip/", defaults={"with_query": False}) @api_web_bp.route("/justificatifs/nip/", defaults={"with_query": False}) @@ -230,8 +232,8 @@ def justificatifs_formsemestre(formsemestre_id: int, with_query: bool = False): @bp.route("/justificatif//create", methods=["POST"]) @api_web_bp.route("/justificatif//create", methods=["POST"]) -@bp.route("/justificatif/etudid//create", methods=["POST"]) -@api_web_bp.route("/justificatif/etudid//create", methods=["POST"]) +@bp.route("/justificatif/etudid//create", methods=["POST"]) +@api_web_bp.route("/justificatif/etudid//create", methods=["POST"]) # nip @bp.route("/justificatif/nip//create", methods=["POST"]) @api_web_bp.route("/justificatif/nip//create", methods=["POST"])