Interdit changement du ref. de comp. si formsemestres existants. Closes #506.

This commit is contained in:
Emmanuel Viennet 2022-11-01 19:37:09 +01:00 committed by iziram
parent 20b13b05cf
commit 4d453d5d14

View File

@ -778,11 +778,17 @@ du programme" (menu "Semestre") si vous avez un semestre en cours);
msg_refcomp = "changer"
H.append(f"""<ul><li>{descr_refcomp}""")
if current_user.has_permission(Permission.ScoChangeFormation):
if (
formation.referentiel_competence is None
or formation.formsemestres.count() == 0
):
H.append(
f"""<a class="stdlink" href="{url_for('notes.refcomp_assoc_formation',
scodoc_dept=g.scodoc_dept, formation_id=formation_id)
}">{msg_refcomp}</a>"""
)
elif formation.referentiel_competence is not None:
H.append("""(non modifiable car utilisé par des semestres)""")
H.append(
f"""</li>