Fix edit evaluation non APC

This commit is contained in:
Emmanuel Viennet 2021-11-18 23:54:50 +01:00
parent e706407bcb
commit 84f25817d1
2 changed files with 8 additions and 7 deletions

View File

@ -321,10 +321,11 @@ def evaluation_create_form(
else: else:
# creation d'une evaluation # creation d'une evaluation
evaluation_id = sco_evaluation_db.do_evaluation_create(**tf[2]) evaluation_id = sco_evaluation_db.do_evaluation_create(**tf[2])
# Set poids if is_apc:
evaluation = models.Evaluation.query.get(evaluation_id) # Set poids
for ue in sem_ues: evaluation = models.Evaluation.query.get(evaluation_id)
evaluation.set_ue_poids(ue, tf[2][f"poids_{ue.id}"]) for ue in sem_ues:
db.session.add(evaluation) evaluation.set_ue_poids(ue, tf[2][f"poids_{ue.id}"])
db.session.commit() db.session.add(evaluation)
db.session.commit()
return flask.redirect(dest_url) return flask.redirect(dest_url)

View File

@ -1619,7 +1619,7 @@ def evaluation_delete(evaluation_id):
) )
) )
else: else:
sco_evaluations.do_evaluation_delete(E["evaluation_id"]) sco_evaluation_db.do_evaluation_delete(E["evaluation_id"])
return ( return (
"\n".join(H) "\n".join(H)
+ f"""<p>OK, évaluation supprimée.</p> + f"""<p>OK, évaluation supprimée.</p>