From e060be1b3da7541f9b7fe275508863831adb303b Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Sun, 30 Jan 2022 09:05:51 +0100 Subject: [PATCH] Close #282 --- app/scodoc/sco_edit_module.py | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/app/scodoc/sco_edit_module.py b/app/scodoc/sco_edit_module.py index 4053bde0e..1c42d53fc 100644 --- a/app/scodoc/sco_edit_module.py +++ b/app/scodoc/sco_edit_module.py @@ -700,8 +700,28 @@ def module_edit(module_id=None): initvalues=module, submitlabel="Modifier ce module", ) + # Affiche liste des formseemstre utilisant ce module + if in_use: + formsemestre_ids = {modimpl.formsemestre_id for modimpl in a_module.modimpls} + formsemestres = [FormSemestre.query.get(fid) for fid in formsemestre_ids] + formsemestres.sort(key=lambda f: f.date_debut) + items = [ + f"""{f.titre}""" + for f in formsemestres + ] + sem_descr = f""" +
+
Ce module est utilisé dans les formsemestres suivants:
+ +
+ """ + # if tf[0] == 0: - return "\n".join(H) + tf[1] + html_sco_header.sco_footer() + return "\n".join(H) + tf[1] + sem_descr + html_sco_header.sco_footer() elif tf[0] == -1: return flask.redirect( url_for(