Import XML: remove useless route and set default module type

This commit is contained in:
Emmanuel Viennet 2022-05-10 21:16:07 +02:00
parent 9e494d39cb
commit 01af698c6c
2 changed files with 5 additions and 11 deletions

View File

@ -256,6 +256,11 @@ def formation_import_xml(doc: str, import_tags=True):
mod_info[1]["formation_id"] = formation_id mod_info[1]["formation_id"] = formation_id
mod_info[1]["matiere_id"] = mat_id mod_info[1]["matiere_id"] = mat_id
mod_info[1]["ue_id"] = ue_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]) mod_id = sco_edit_module.do_module_create(mod_info[1])
if xml_module_id: if xml_module_id:
modules_old2new[int(xml_module_id)] = mod_id modules_old2new[int(xml_module_id)] = mod_id

View File

@ -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"]) @bp.route("/formation_import_xml_form", methods=["GET", "POST"])
@scodoc @scodoc
@permission_required(Permission.ScoChangeFormation) @permission_required(Permission.ScoChangeFormation)