Fix: suppression anciennes UE avec formules

This commit is contained in:
Emmanuel Viennet 2022-06-29 13:27:29 +02:00
parent 72144a4952
commit 081ad0d5e9

View File

@ -52,7 +52,6 @@ from app.scodoc.sco_exceptions import (
)
from app.scodoc import html_sco_header
from app.scodoc import sco_cache
from app.scodoc import sco_codes_parcours
from app.scodoc import sco_edit_apc
from app.scodoc import sco_edit_matiere
@ -188,7 +187,11 @@ def do_ue_delete(ue_id, delete_validations=False, force=False):
"DELETE FROM scolar_formsemestre_validation WHERE ue_id=%(ue_id)s",
{"ue_id": ue.id},
)
# delete old formulas
ndb.SimpleQuery(
"DELETE FROM notes_formsemestre_ue_computation_expr WHERE ue_id=%(ue_id)s",
{"ue_id": ue.id},
)
# delete all matiere in this UE
mats = sco_edit_matiere.matiere_list({"ue_id": ue.id})
for mat in mats: