From e8ce1e303ea99ebce2244bd3370bf4cd2f811341 Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Sun, 24 Oct 2021 11:43:53 +0200 Subject: [PATCH] formation_export: n'exporte plus les UE externes --- app/scodoc/sco_formations.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/app/scodoc/sco_formations.py b/app/scodoc/sco_formations.py index 5e4f0ab69..8aa7c72c2 100644 --- a/app/scodoc/sco_formations.py +++ b/app/scodoc/sco_formations.py @@ -93,12 +93,21 @@ def formation_has_locked_sems(formation_id): return sems -def formation_export(formation_id, export_ids=False, export_tags=True, format=None): +def formation_export( + formation_id, + export_ids=False, + export_tags=True, + export_external_ues=False, + format=None, +): """Get a formation, with UE, matieres, modules in desired format """ F = formation_list(args={"formation_id": formation_id})[0] - ues = sco_edit_ue.ue_list({"formation_id": formation_id}) + selector = {"formation_id": formation_id} + if not export_external_ues: + selector["is_external"] = False + ues = sco_edit_ue.ue_list(selector) F["ue"] = ues for ue in ues: ue_id = ue["ue_id"]