diff --git a/app/scodoc/sco_formsemestre_edit.py b/app/scodoc/sco_formsemestre_edit.py
index 8ce6293553..6ac094f79b 100644
--- a/app/scodoc/sco_formsemestre_edit.py
+++ b/app/scodoc/sco_formsemestre_edit.py
@@ -75,10 +75,13 @@ def formsemestre_createwithmodules(context, REQUEST=None):
bodyOnLoad="init_tf_form('')",
),
"""
Mise en place d'un semestre de formation
""",
- do_formsemestre_createwithmodules(context, REQUEST=REQUEST),
- html_sco_header.sco_footer(context, REQUEST),
]
- return "\n".join(H)
+ r = do_formsemestre_createwithmodules(context, REQUEST=REQUEST)
+ if isinstance(r, basestring):
+ H.append(r)
+ else:
+ return r # response redirect
+ return "\n".join(H) + html_sco_header.sco_footer(context, REQUEST)
def formsemestre_editwithmodules(context, REQUEST, formsemestre_id):
@@ -102,7 +105,11 @@ def formsemestre_editwithmodules(context, REQUEST, formsemestre_id):
% scu.icontag("lock_img", border="0", title="Semestre verrouillé")
)
else:
- H.append(do_formsemestre_createwithmodules(context, REQUEST=REQUEST, edit=1))
+ r = do_formsemestre_createwithmodules(context, REQUEST=REQUEST, edit=1)
+ if isinstance(r, basestring):
+ H.append(r)
+ else:
+ return r # response redirect
if not REQUEST.form.get("tf-submitted", False):
H.append(
"""Seuls les modules cochés font partie de ce semestre. Pour les retirer, les décocher et appuyer sur le bouton "modifier".
@@ -738,11 +745,10 @@ def do_formsemestre_createwithmodules(context, REQUEST=None, edit=False):
"responsable_id": tf[2][module_id],
}
_ = sco_moduleimpl.do_moduleimpl_create(context, modargs)
- REQUEST.RESPONSE.redirect(
+ return REQUEST.RESPONSE.redirect(
"formsemestre_status?formsemestre_id=%s&head_message=Nouveau%%20semestre%%20créé"
% formsemestre_id
)
- return ""
else:
# modification du semestre:
# on doit creer les modules nouvellement selectionnés