From f2718635bb83ed8c99ec53d95f45602bd0c1a466 Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Thu, 5 May 2022 19:49:43 +0200 Subject: [PATCH] API: ajout /departement//formsemestres_ids --- app/api/departements.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/app/api/departements.py b/app/api/departements.py index c3a4d2e7e..fca5d6a82 100644 --- a/app/api/departements.py +++ b/app/api/departements.py @@ -89,6 +89,16 @@ def list_etudiants(dept_ident: str): return jsonify([etud.to_dict_short() for etud in dept.etudiants]) +@bp.route("/departement//formsemestres_ids", methods=["GET"]) +@token_auth.login_required +@token_permission_required(Permission.APIView) +def formsemestres_ids(dept_ident: str): + """liste des ids formsemestre du département""" + # Le département, spécifié par un id ou un acronyme + dept = get_departement(dept_ident) + return jsonify([formsemestre.id for formsemestre in dept.formsemestres]) + + @bp.route("/departement//formsemestres_courants", methods=["GET"]) @token_auth.login_required @token_permission_required(Permission.APIView)