forked from ScoDoc/ScoDoc
Fix: changement de référentiel de compétences
This commit is contained in:
parent
538a5427ba
commit
1b297580c9
@ -224,7 +224,7 @@ def do_formsemestres_associate_new_version(
|
|||||||
_reassociate_moduleimpls(formsemestre, ues_old2new, modules_old2new)
|
_reassociate_moduleimpls(formsemestre, ues_old2new, modules_old2new)
|
||||||
|
|
||||||
db.session.commit()
|
db.session.commit()
|
||||||
return formation_id
|
return new_formation_id
|
||||||
|
|
||||||
|
|
||||||
def _reassociate_moduleimpls(
|
def _reassociate_moduleimpls(
|
||||||
|
@ -149,10 +149,14 @@ def refcomp_assoc_formation(formation_id: int):
|
|||||||
db.session.get(ApcReferentielCompetences, referentiel_competence_id)
|
db.session.get(ApcReferentielCompetences, referentiel_competence_id)
|
||||||
is not None
|
is not None
|
||||||
)
|
)
|
||||||
formation.referentiel_competence_id = referentiel_competence_id
|
if formation.referentiel_competence_id != referentiel_competence_id:
|
||||||
db.session.add(formation)
|
formation.refcomp_desassoc()
|
||||||
db.session.commit()
|
formation.referentiel_competence_id = referentiel_competence_id
|
||||||
flash("nouveau référentiel de compétences associé")
|
db.session.add(formation)
|
||||||
|
db.session.commit()
|
||||||
|
flash("Nouveau référentiel de compétences associé")
|
||||||
|
else:
|
||||||
|
flash("Pas de changements")
|
||||||
return redirect(
|
return redirect(
|
||||||
url_for(
|
url_for(
|
||||||
"notes.ue_table", scodoc_dept=g.scodoc_dept, formation_id=formation_id
|
"notes.ue_table", scodoc_dept=g.scodoc_dept, formation_id=formation_id
|
||||||
@ -172,7 +176,7 @@ def refcomp_assoc_formation(formation_id: int):
|
|||||||
@permission_required(Permission.ScoChangeFormation)
|
@permission_required(Permission.ScoChangeFormation)
|
||||||
def refcomp_desassoc_formation(formation_id: int):
|
def refcomp_desassoc_formation(formation_id: int):
|
||||||
"""Désassocie la formation de son ref. de compétence"""
|
"""Désassocie la formation de son ref. de compétence"""
|
||||||
formation = Formation.query.get_or_404(formation_id)
|
formation: Formation = Formation.query.get_or_404(formation_id)
|
||||||
formation.refcomp_desassoc()
|
formation.refcomp_desassoc()
|
||||||
return redirect(
|
return redirect(
|
||||||
url_for("notes.ue_table", scodoc_dept=g.scodoc_dept, formation_id=formation.id)
|
url_for("notes.ue_table", scodoc_dept=g.scodoc_dept, formation_id=formation.id)
|
||||||
|
Loading…
Reference in New Issue
Block a user