From 4a3ceb291aad0ea42069e40fe2e2bbf5fd4f3de1 Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Tue, 2 Aug 2022 16:10:09 +0200 Subject: [PATCH] API : resultat formsemestre_order_partitions --- app/api/partitions.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/api/partitions.py b/app/api/partitions.py index 1f7280ca..1dac1b8b 100644 --- a/app/api/partitions.py +++ b/app/api/partitions.py @@ -415,7 +415,13 @@ def formsemestre_order_partitions(formsemestre_id: int): db.session.commit() app.set_sco_dept(formsemestre.departement.acronym) sco_cache.invalidate_formsemestre(formsemestre_id) - return jsonify(formsemestre.to_dict_api()) + return jsonify( + [ + partition.to_dict() + for partition in formsemestre.partitions.order_by(Partition.numero) + if partition["partition_name"] is not None + ] + ) @bp.route("/partition//groups/order", methods=["POST"])