From 84f25817d112bc0952b49683f306159acd175871 Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Thu, 18 Nov 2021 23:54:50 +0100 Subject: [PATCH] Fix edit evaluation non APC --- app/scodoc/sco_evaluation_edit.py | 13 +++++++------ app/views/notes.py | 2 +- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/app/scodoc/sco_evaluation_edit.py b/app/scodoc/sco_evaluation_edit.py index 36b12ca25..e6619fe2f 100644 --- a/app/scodoc/sco_evaluation_edit.py +++ b/app/scodoc/sco_evaluation_edit.py @@ -321,10 +321,11 @@ def evaluation_create_form( else: # creation d'une evaluation evaluation_id = sco_evaluation_db.do_evaluation_create(**tf[2]) - # Set poids - evaluation = models.Evaluation.query.get(evaluation_id) - for ue in sem_ues: - evaluation.set_ue_poids(ue, tf[2][f"poids_{ue.id}"]) - db.session.add(evaluation) - db.session.commit() + if is_apc: + # Set poids + evaluation = models.Evaluation.query.get(evaluation_id) + for ue in sem_ues: + evaluation.set_ue_poids(ue, tf[2][f"poids_{ue.id}"]) + db.session.add(evaluation) + db.session.commit() return flask.redirect(dest_url) diff --git a/app/views/notes.py b/app/views/notes.py index 7423f1f8a..f72705709 100644 --- a/app/views/notes.py +++ b/app/views/notes.py @@ -1619,7 +1619,7 @@ def evaluation_delete(evaluation_id): ) ) else: - sco_evaluations.do_evaluation_delete(E["evaluation_id"]) + sco_evaluation_db.do_evaluation_delete(E["evaluation_id"]) return ( "\n".join(H) + f"""

OK, évaluation supprimée.