Update opolka/ScoDoc from ScoDoc/ScoDoc #2

Merged
opolka merged 1272 commits from ScoDoc/ScoDoc:master into master 2024-05-27 09:11:04 +02:00
Showing only changes of commit 09d59848d6 - Show all commits

View File

@ -78,6 +78,13 @@ def import_formation(dept_id: int) -> Formation:
) )
formation.referentiel_competence_id = ref_comp.id formation.referentiel_competence_id = ref_comp.id
db.session.add(formation) db.session.add(formation)
# --- Association niveaux de compétences aux UE de S1:
niveaux = ref_comp.get_niveaux_by_parcours(1)[1]["TC"]
ues = formation.ues.filter_by(semestre_idx=1).all()
assert len(niveaux) == len(ues) # le ref comp et les formation doivent correspondre
for ue, niveau in zip(ues, niveaux):
ue.niveau_competence = niveau
db.session.add(ue)
db.session.commit() db.session.commit()
return formation return formation