ne présente plus le lien 'ajouter semestre' si on n'a pas le droit

This commit is contained in:
Emmanuel Viennet 2024-03-27 17:12:28 +01:00
parent b841b2f708
commit 0ed2455028

View File

@ -507,6 +507,7 @@ def formation_list_table() -> GenTable:
)
editable = current_user.has_permission(Permission.EditFormation)
can_implement = current_user.has_permission(Permission.EditFormSemestre)
# Traduit/ajoute des champs à afficher:
rows = []
@ -547,15 +548,18 @@ def formation_list_table() -> GenTable:
)}">{s.session_id()}</a>"""
for s in row["formsemestres"]
]
+ [
f"""<a class="stdlink" id="add-semestre-{
formation.acronyme.lower().replace(" ", "-")}"
+ (
[
f"""<a class="stdlink"
href="{ url_for("notes.formsemestre_createwithmodules",
scodoc_dept=g.scodoc_dept, formation_id=formation.id, semestre_id=1
)
}">ajouter</a>
"""
]
if can_implement
else []
)
)
if row["formsemestres"]:
row["date_fin_dernier_sem"] = (