diff --git a/app/decorators.py b/app/decorators.py index e4867cd21b..a14c3aff31 100644 --- a/app/decorators.py +++ b/app/decorators.py @@ -124,17 +124,17 @@ def scodoc7func(context): If called via a route, this decorator setups a REQUEST object (emulating Zope2 REQUEST) and `g.scodoc_dept` if present in the argument (for routes like `//Scolarite/sco_exemple`). """ - assert not args # Détermine si on est appelé via une route ("toplevel") # ou par un appel de fonction python normal. top_level = not hasattr(g, "zrequest") - if top_level: - g.zrequest = None + if not top_level: + # ne "redécore" pas + return func(*args, **kwargs) # if "scodoc_dept" in kwargs: g.scodoc_dept = kwargs["scodoc_dept"] del kwargs["scodoc_dept"] - elif not hasattr(g, "scodoc_dept"): # if toplevel call + elif not hasattr(g, "scodoc_dept"): g.scodoc_dept = None # --- Emulate Zope's REQUEST REQUEST = ZRequest() diff --git a/app/scodoc/pe_jurype.py b/app/scodoc/pe_jurype.py index d0c5bae3ad..c9f86ad38b 100644 --- a/app/scodoc/pe_jurype.py +++ b/app/scodoc/pe_jurype.py @@ -66,7 +66,7 @@ def comp_nom_semestre_dans_parcours(context, sem): """Le nom a afficher pour titrer un semestre par exemple: "semestre 2 FI 2015" """ - F = context.Notes.formation_list(args={"formation_id": sem["formation_id"]})[0] + F = context.formation_list(args={"formation_id": sem["formation_id"]})[0] parcours = sco_codes_parcours.get_parcours_from_code(F["type_parcours"]) return "%s %s %s %s" % ( parcours.SESSION_NAME, # eg "semestre" diff --git a/app/scodoc/sco_edit_formation.py b/app/scodoc/sco_edit_formation.py index 845c3cb79b..b21fa9bbc0 100644 --- a/app/scodoc/sco_edit_formation.py +++ b/app/scodoc/sco_edit_formation.py @@ -245,7 +245,7 @@ def do_formation_create(context, args, REQUEST): if args.has_key("formation_code") and not args["formation_code"]: del args["formation_code"] # - r = _formationEditor.create(cnx, args) + r = sco_formations._formationEditor.create(cnx, args) sco_news.add( context, diff --git a/app/scodoc/sco_edit_module.py b/app/scodoc/sco_edit_module.py index e2847b3197..56f49fe854 100644 --- a/app/scodoc/sco_edit_module.py +++ b/app/scodoc/sco_edit_module.py @@ -422,9 +422,7 @@ def module_list(context, formation_id, REQUEST=None): % F, '