From a9bc28a49ef55ebdf347475e3e429f35f4ddf878 Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Thu, 24 Oct 2024 11:22:48 +0200 Subject: [PATCH] Fix regression: cancel button in old forms --- app/scodoc/TrivialFormulator.py | 5 +++-- app/scodoc/sco_formsemestre_edit.py | 7 ++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/app/scodoc/TrivialFormulator.py b/app/scodoc/TrivialFormulator.py index 0e925ce9d..8bc15bda7 100644 --- a/app/scodoc/TrivialFormulator.py +++ b/app/scodoc/TrivialFormulator.py @@ -442,8 +442,9 @@ class TF(object): self.formid}_submit" id="{self.formid}_submit" value="{self.submitlabel }" {' '.join(self.submitbuttonattributes)}/>""" if self.cancelbutton: - buttons_markup += f""" """ + buttons_markup += f""" """ buttons_markup += "" R = [] diff --git a/app/scodoc/sco_formsemestre_edit.py b/app/scodoc/sco_formsemestre_edit.py index 0060b9b03..0e189dafe 100644 --- a/app/scodoc/sco_formsemestre_edit.py +++ b/app/scodoc/sco_formsemestre_edit.py @@ -706,8 +706,7 @@ def do_formsemestre_createwithmodules(edit=False, formsemestre: FormSemestre = N def opt_selected(gid): if gid == vals.get(select_name): return "selected" - else: - return "" + return "" if mod.id in module_ids_set: # pas de menu inscription si le module est déjà présent @@ -866,7 +865,7 @@ def do_formsemestre_createwithmodules(edit=False, formsemestre: FormSemestre = N {msg} {tf[1]} """ - elif tf[0] == -1: + if tf[0] == -1: # Annulation if formsemestre: return redirect( url_for( @@ -876,6 +875,7 @@ def do_formsemestre_createwithmodules(edit=False, formsemestre: FormSemestre = N ) ) return redirect(url_for("notes.index_html", scodoc_dept=g.scodoc_dept)) + # Edition ou modification du semestre tf[2]["gestion_compensation"] = bool(tf[2]["gestion_compensation_lst"]) tf[2]["gestion_semestrielle"] = bool(tf[2]["gestion_semestrielle_lst"]) @@ -890,6 +890,7 @@ def do_formsemestre_createwithmodules(edit=False, formsemestre: FormSemestre = N # (retire le "MI" du début du nom de champs) module_ids_checked = [int(x[2:]) for x in tf[2]["tf-checked"]] _formsemestre_check_ue_bonus_unicity(module_ids_checked) + ok = False if not edit: if is_apc: _formsemestre_check_module_list(module_ids_checked, tf[2]["semestre_id"])