1
0
forked from ScoDoc/ScoDoc

Fix: clonage semestre sans dates évaluations

This commit is contained in:
Emmanuel Viennet 2024-07-15 21:22:21 +02:00
parent 068b6a5c6a
commit a25407565c

View File

@ -1332,6 +1332,8 @@ def do_formsemestre_clone(
args = dict(e.__dict__) args = dict(e.__dict__)
args.pop("_sa_instance_state") args.pop("_sa_instance_state")
args.pop("id") args.pop("id")
args.pop("date_debut", None)
args.pop("date_fin", None)
args["moduleimpl_id"] = modimpl_new.id args["moduleimpl_id"] = modimpl_new.id
new_eval = Evaluation(**args) new_eval = Evaluation(**args)
db.session.add(new_eval) db.session.add(new_eval)
@ -1339,7 +1341,10 @@ def do_formsemestre_clone(
# Copie les poids APC de l'évaluation # Copie les poids APC de l'évaluation
new_eval.set_ue_poids_dict(e.get_ue_poids_dict()) new_eval.set_ue_poids_dict(e.get_ue_poids_dict())
db.session.commit() db.session.commit()
if clone_evaluations:
flash(
"Attention: les évaluations n'ont plus de dates: n'oubliez pas de les indiquer"
)
# 3- copy uecoefs # 3- copy uecoefs
for ue_coef in FormSemestreUECoef.query.filter_by( for ue_coef in FormSemestreUECoef.query.filter_by(
formsemestre_id=formsemestre_orig.id formsemestre_id=formsemestre_orig.id