Optimisation affectation notes manquantes

This commit is contained in:
Emmanuel Viennet 2024-07-19 19:12:19 +02:00
parent 929fe397ad
commit e91503a9b5

View File

@ -58,12 +58,13 @@ from app.scodoc.sco_permissions import Permission
import app.scodoc.sco_utils as scu import app.scodoc.sco_utils as scu
from app.scodoc.sco_utils import ModuleType from app.scodoc.sco_utils import ModuleType
from app.scodoc import codes_cursus
from app.scodoc import html_sco_header from app.scodoc import html_sco_header
from app.scodoc import htmlutils from app.scodoc import htmlutils
from app.scodoc import sco_archives_formsemestre from app.scodoc import sco_archives_formsemestre
from app.scodoc import sco_assiduites as scass from app.scodoc import sco_assiduites as scass
from app.scodoc import sco_bulletins from app.scodoc import sco_bulletins
from app.scodoc import codes_cursus from app.scodoc import sco_cache
from app.scodoc import sco_evaluations from app.scodoc import sco_evaluations
from app.scodoc import sco_formations from app.scodoc import sco_formations
from app.scodoc import sco_formsemestre from app.scodoc import sco_formsemestre
@ -1472,8 +1473,9 @@ def formsemestre_note_etuds_sans_notes(
if request.method == "POST": if request.method == "POST":
if not code in ("ATT", "EXC", "ABS"): if not code in ("ATT", "EXC", "ABS"):
raise ScoValueError("code invalide: doit être ATT, ABS ou EXC") raise ScoValueError("code invalide: doit être ATT, ABS ou EXC")
for etud in etuds: with sco_cache.DeferredSemCacheManager():
formsemestre.etud_set_all_missing_notes(etud, code) for etud in etuds:
formsemestre.etud_set_all_missing_notes(etud, code)
flash(f"Notes de {len(etuds)} étudiants affectées à {code}") flash(f"Notes de {len(etuds)} étudiants affectées à {code}")
return redirect( return redirect(
url_for( url_for(