Fix: Supprimer coef

This commit is contained in:
Éric Li 2021-06-09 10:36:48 +02:00
parent 095a25b59c
commit 82d84d6b50
2 changed files with 3 additions and 1 deletions

BIN
app.db

Binary file not shown.

View File

@ -54,7 +54,9 @@ def Semestre(num):
for coeffield in field.coef: for coeffield in field.coef:
codeClass, code = coeffield.objetformation.data[1:-1].split() codeClass, code = coeffield.objetformation.data[1:-1].split()
model = getattr(models, codeClass) model = getattr(models, codeClass)
model.query.filter_by(code=code).first().setCoef(coeffield.coef.data, ue) objetformation = model.query.filter_by(code=code).first()
if objetformation in field.saes.data or objetformation in field.ressources.data:
objetformation.setCoef(coeffield.coef.data, ue)
db.session.commit() db.session.commit()
return redirect(url_for("Semestre", num=num)) return redirect(url_for("Semestre", num=num))
# Remplis les fields des informations que l'ue possède # Remplis les fields des informations que l'ue possède