diff --git a/app/api/formsemestres.py b/app/api/formsemestres.py index bdcb46164..c086b6278 100644 --- a/app/api/formsemestres.py +++ b/app/api/formsemestres.py @@ -7,6 +7,7 @@ import app from app import models from app.api import bp from app.api.auth import token_auth, token_permission_required +from app.api.errors import error_response from app.comp import res_sem from app.comp.moy_mod import ModuleImplResults from app.comp.res_compat import NotesTableCompat @@ -91,7 +92,13 @@ def formsemestre_apo(etape_apo: str): FormSemestreEtape.formsemestre_id == FormSemestre.id, ) - return jsonify([formsemestre.to_dict() for formsemestre in formsemestres]) + res = [formsemestre.to_dict() for formsemestre in formsemestres] + if len(res) == 0: + return error_response( + 404, message="Aucun formsemestre trouvé avec cette étape apogée" + ) + else: + return jsonify(res) @bp.route("/formsemestre//bulletins", methods=["GET"])