From 01af698c6c6b7c741858d08ec7e5282fb71a2bfe Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Tue, 10 May 2022 21:16:07 +0200 Subject: [PATCH] Import XML: remove useless route and set default module type --- app/scodoc/sco_formations.py | 5 +++++ app/views/notes.py | 11 ----------- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/app/scodoc/sco_formations.py b/app/scodoc/sco_formations.py index 178138b22..6c6e70194 100644 --- a/app/scodoc/sco_formations.py +++ b/app/scodoc/sco_formations.py @@ -256,6 +256,11 @@ def formation_import_xml(doc: str, import_tags=True): mod_info[1]["formation_id"] = formation_id mod_info[1]["matiere_id"] = mat_id mod_info[1]["ue_id"] = ue_id + mod_info[1]["module_type"] = ( + scu.ModuleType.STANDARD + if mod_info[1]["module_type"] is None + else mod_info[1]["module_type"] + ) mod_id = sco_edit_module.do_module_create(mod_info[1]) if xml_module_id: modules_old2new[int(xml_module_id)] = mod_id diff --git a/app/views/notes.py b/app/views/notes.py index e66a42f7b..86c4f6f73 100644 --- a/app/views/notes.py +++ b/app/views/notes.py @@ -648,17 +648,6 @@ def formation_export(formation_id, export_ids=False, format=None): ) -@bp.route("/formation_import_xml") -@scodoc -@permission_required(Permission.ScoChangeFormation) -@scodoc7func -def formation_import_xml(file): - "import d'une formation en XML" - log("formation_import_xml") - doc = file.read() - return sco_formations.formation_import_xml(doc) - - @bp.route("/formation_import_xml_form", methods=["GET", "POST"]) @scodoc @permission_required(Permission.ScoChangeFormation)