This commit is contained in:
Jean-Marie Place 2023-02-20 10:53:29 +01:00 committed by iziram
parent 0b118a6947
commit 64f6b01140

View File

@ -494,20 +494,18 @@ def formation_list_table(formation_id=None, args={}):
else: else:
f["date_fin_dernier_sem"] = "" f["date_fin_dernier_sem"] = ""
f["annee_dernier_sem"] = "" f["annee_dernier_sem"] = ""
locked = formation_has_locked_sems(f["formation_id"]) formation: Formation = Formation.query.get_or_404(f["formation_id"])
locked = formation.has_locked_sems()
# #
if locked: if locked:
but_locked = lockicon but_locked = lockicon
else: else:
but_locked = '<span class="but_placeholder"></span>' but_locked = '<span class="but_placeholder"></span>'
if editable and not locked: if editable and not locked:
but_suppr = ( but_suppr = '<a class="stdlink" href="formation_delete?formation_id=%s" id="delete-formation-%s">%s</a>' % (
'<a class="stdlink" href="formation_delete?formation_id=%s" id="delete-formation-%s">%s</a>' f["formation_id"],
% ( f["acronyme"].lower().replace(" ", "-"),
f["formation_id"], suppricon,
f["acronyme"].lower().replace(" ", "-"),
suppricon,
)
) )
else: else:
but_suppr = '<span class="but_placeholder"></span>' but_suppr = '<span class="but_placeholder"></span>'