formation_export: n'exporte plus les UE externes

This commit is contained in:
Emmanuel Viennet 2021-10-24 11:43:53 +02:00
parent 2fe9e5ec39
commit e8ce1e303e

View File

@ -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"]