diff --git a/app/scodoc/sco_formations.py b/app/scodoc/sco_formations.py
index 93d0e1fb..7a77029e 100644
--- a/app/scodoc/sco_formations.py
+++ b/app/scodoc/sco_formations.py
@@ -494,20 +494,18 @@ def formation_list_table(formation_id=None, args={}):
else:
f["date_fin_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:
but_locked = lockicon
else:
but_locked = ''
if editable and not locked:
- but_suppr = (
- '%s'
- % (
- f["formation_id"],
- f["acronyme"].lower().replace(" ", "-"),
- suppricon,
- )
+ but_suppr = '%s' % (
+ f["formation_id"],
+ f["acronyme"].lower().replace(" ", "-"),
+ suppricon,
)
else:
but_suppr = ''