forked from ScoDoc/ScoDoc
Update opolka/ScoDoc from ScoDoc/ScoDoc #2
@ -78,6 +78,13 @@ def import_formation(dept_id: int) -> Formation:
|
||||
)
|
||||
formation.referentiel_competence_id = ref_comp.id
|
||||
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()
|
||||
return formation
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user