From 504a15fc8c706ab4db47487af17bc5e3f02aa763 Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Sun, 15 Aug 2021 23:10:15 +0200 Subject: [PATCH] fixes: clonage et nouvelles versions programmes OK --- app/scodoc/sco_edit_module.py | 2 +- app/scodoc/sco_formations.py | 2 +- app/scodoc/sco_tag_module.py | 4 +++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/app/scodoc/sco_edit_module.py b/app/scodoc/sco_edit_module.py index 51f84379..f4394339 100644 --- a/app/scodoc/sco_edit_module.py +++ b/app/scodoc/sco_edit_module.py @@ -99,7 +99,7 @@ def do_module_list(context, *args, **kw): return _moduleEditor.list(cnx, *args, **kw) -def do_module_create(context, args): +def do_module_create(context, args) -> int: "create a module" # create from app.scodoc import sco_formations diff --git a/app/scodoc/sco_formations.py b/app/scodoc/sco_formations.py index 162900e7..02d0c4b9 100644 --- a/app/scodoc/sco_formations.py +++ b/app/scodoc/sco_formations.py @@ -223,7 +223,7 @@ def formation_import_xml(context, doc: str, import_tags=True): mod_info[1]["ue_id"] = ue_id mod_id = sco_edit_module.do_module_create(context, mod_info[1]) if xml_module_id: - modules_old2new[xml_module_id] = mod_id + modules_old2new[int(xml_module_id)] = mod_id if import_tags: if len(mod_info) > 2: tag_names = [t[1]["name"] for t in mod_info[2]] diff --git a/app/scodoc/sco_tag_module.py b/app/scodoc/sco_tag_module.py index 93786f16..ecd7a901 100644 --- a/app/scodoc/sco_tag_module.py +++ b/app/scodoc/sco_tag_module.py @@ -35,6 +35,8 @@ """ import http +from flask import g, url_for + import app.scodoc.sco_utils as scu import app.scodoc.notesdb as ndb from app.scodoc.notes_log import log @@ -75,7 +77,7 @@ class ScoTag(object): r = ndb.SimpleDictFetch( "SELECT id as tag_id, * FROM " + self.tag_table - + " WHERE dept_id=%(dept_id) AND title = %(title)s", + + " WHERE dept_id=%(dept_id)s AND title = %(title)s", {"dept_id": g.scodoc_dept_id, "title": self.title}, ) if r: