This commit is contained in:
Emmanuel Viennet 2022-05-10 21:21:18 +02:00
commit d43b1c60ce
2 changed files with 13 additions and 10 deletions

View File

@ -983,7 +983,8 @@ def _tables_abs_etud(
)[0]
if format == "html":
ex.append(
f"""<a href="{url_for('notes.moduleimpl_status',
f"""<a title="{mod['module']['titre']}"
href="{url_for('notes.moduleimpl_status',
scodoc_dept=g.scodoc_dept, moduleimpl_id=mod["moduleimpl_id"])}
">{mod["module"]["code"] or '(module sans code)'}</a>"""
)

View File

@ -156,6 +156,8 @@ def do_ue_delete(ue_id, delete_validations=False, force=False):
from app.scodoc import sco_parcours_dut
ue = UniteEns.query.get_or_404(ue_id)
formation_id = ue.formation_id
semestre_idx = ue.semestre_idx
if not can_delete_ue(ue):
raise ScoNonEmptyFormationObject(
"UE",
@ -163,8 +165,8 @@ def do_ue_delete(ue_id, delete_validations=False, force=False):
dest_url=url_for(
"notes.ue_table",
scodoc_dept=g.scodoc_dept,
formation_id=ue.formation_id,
semestre_idx=ue.semestre_idx,
formation_id=formation_id,
semestre_idx=semestre_idx,
),
)
@ -187,13 +189,13 @@ def do_ue_delete(ue_id, delete_validations=False, force=False):
cancel_url=url_for(
"notes.ue_table",
scodoc_dept=g.scodoc_dept,
formation_id=ue.formation_id,
semestre_idx=ue.semestre_idx,
formation_id=formation_id,
semestre_idx=semestre_idx,
),
parameters={"ue_id": ue.id, "dialog_confirmed": 1},
)
if delete_validations:
log("deleting all validations of UE %s" % ue.id)
log(f"deleting all validations of UE {ue.id}")
ndb.SimpleQuery(
"DELETE FROM scolar_formsemestre_validation WHERE ue_id=%(ue_id)s",
{"ue_id": ue.id},
@ -215,10 +217,10 @@ def do_ue_delete(ue_id, delete_validations=False, force=False):
# utilisé: acceptable de tout invalider):
sco_cache.invalidate_formsemestre()
# news
F = sco_formations.formation_list(args={"formation_id": ue.formation_id})[0]
F = sco_formations.formation_list(args={"formation_id": formation_id})[0]
ScolarNews.add(
typ=ScolarNews.NEWS_FORM,
obj=ue.formation_id,
obj=formation_id,
text=f"Modification de la formation {F['acronyme']}",
max_frequency=10 * 60,
)
@ -228,8 +230,8 @@ def do_ue_delete(ue_id, delete_validations=False, force=False):
url_for(
"notes.ue_table",
scodoc_dept=g.scodoc_dept,
formation_id=ue.formation_id,
semestre_idx=ue.semestre_idx,
formation_id=formation_id,
semestre_idx=semestre_idx,
)
)
return None