From 0d638de2090ea229e6ade3bf5c110623140c819d Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Tue, 10 May 2022 17:56:21 +0200 Subject: [PATCH 1/2] Fix: UE delete --- app/scodoc/sco_edit_ue.py | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/app/scodoc/sco_edit_ue.py b/app/scodoc/sco_edit_ue.py index fd25e5da3..4c0a8ef59 100644 --- a/app/scodoc/sco_edit_ue.py +++ b/app/scodoc/sco_edit_ue.py @@ -156,6 +156,8 @@ def do_ue_delete(ue_id, delete_validations=False, force=False): from app.scodoc import sco_parcours_dut ue = UniteEns.query.get_or_404(ue_id) + formation_id = ue.formation_id + semestre_idx = ue.semestre_idx if not can_delete_ue(ue): raise ScoNonEmptyFormationObject( "UE", @@ -163,8 +165,8 @@ def do_ue_delete(ue_id, delete_validations=False, force=False): dest_url=url_for( "notes.ue_table", scodoc_dept=g.scodoc_dept, - formation_id=ue.formation_id, - semestre_idx=ue.semestre_idx, + formation_id=formation_id, + semestre_idx=semestre_idx, ), ) @@ -187,13 +189,13 @@ def do_ue_delete(ue_id, delete_validations=False, force=False): cancel_url=url_for( "notes.ue_table", scodoc_dept=g.scodoc_dept, - formation_id=ue.formation_id, - semestre_idx=ue.semestre_idx, + formation_id=formation_id, + semestre_idx=semestre_idx, ), parameters={"ue_id": ue.id, "dialog_confirmed": 1}, ) if delete_validations: - log("deleting all validations of UE %s" % ue.id) + log(f"deleting all validations of UE {ue.id}") ndb.SimpleQuery( "DELETE FROM scolar_formsemestre_validation WHERE ue_id=%(ue_id)s", {"ue_id": ue.id}, @@ -215,10 +217,10 @@ def do_ue_delete(ue_id, delete_validations=False, force=False): # utilisé: acceptable de tout invalider): sco_cache.invalidate_formsemestre() # news - F = sco_formations.formation_list(args={"formation_id": ue.formation_id})[0] + F = sco_formations.formation_list(args={"formation_id": formation_id})[0] ScolarNews.add( typ=ScolarNews.NEWS_FORM, - obj=ue.formation_id, + obj=formation_id, text=f"Modification de la formation {F['acronyme']}", max_frequency=10 * 60, ) @@ -228,8 +230,8 @@ def do_ue_delete(ue_id, delete_validations=False, force=False): url_for( "notes.ue_table", scodoc_dept=g.scodoc_dept, - formation_id=ue.formation_id, - semestre_idx=ue.semestre_idx, + formation_id=formation_id, + semestre_idx=semestre_idx, ) ) return None From a40cea67f08d6d550d2208fecf184301c77c766b Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Tue, 10 May 2022 18:03:33 +0200 Subject: [PATCH 2/2] =?UTF-8?q?Compl=C3=A8te=20#377:=20bulles=20aide=20sur?= =?UTF-8?q?=20liste=20abs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/scodoc/sco_abs_views.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/scodoc/sco_abs_views.py b/app/scodoc/sco_abs_views.py index 8427777f2..c01588df6 100644 --- a/app/scodoc/sco_abs_views.py +++ b/app/scodoc/sco_abs_views.py @@ -983,7 +983,8 @@ def _tables_abs_etud( )[0] if format == "html": ex.append( - f"""{mod["module"]["code"] or '(module sans code)'}""" )