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
2 changed files with 10 additions and 6 deletions
Showing only changes of commit 1b297580c9 - Show all commits

View File

@ -224,7 +224,7 @@ def do_formsemestres_associate_new_version(
_reassociate_moduleimpls(formsemestre, ues_old2new, modules_old2new)
db.session.commit()
return formation_id
return new_formation_id
def _reassociate_moduleimpls(

View File

@ -149,10 +149,14 @@ def refcomp_assoc_formation(formation_id: int):
db.session.get(ApcReferentielCompetences, referentiel_competence_id)
is not None
)
formation.referentiel_competence_id = referentiel_competence_id
db.session.add(formation)
db.session.commit()
flash("nouveau référentiel de compétences associé")
if formation.referentiel_competence_id != referentiel_competence_id:
formation.refcomp_desassoc()
formation.referentiel_competence_id = referentiel_competence_id
db.session.add(formation)
db.session.commit()
flash("Nouveau référentiel de compétences associé")
else:
flash("Pas de changements")
return redirect(
url_for(
"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)
def refcomp_desassoc_formation(formation_id: int):
"""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()
return redirect(
url_for("notes.ue_table", scodoc_dept=g.scodoc_dept, formation_id=formation.id)