1
0
forked from ScoDoc/ScoDoc

Fix+code cleaning: saisie notes manquantes

This commit is contained in:
Emmanuel Viennet 2022-09-03 16:17:56 +02:00
parent 227b94ac6a
commit c67d9a4ba5

View File

@ -302,8 +302,6 @@ def do_evaluation_upload_xls():
def do_evaluation_set_missing(evaluation_id, value, dialog_confirmed=False): def do_evaluation_set_missing(evaluation_id, value, dialog_confirmed=False):
"""Initialisation des notes manquantes""" """Initialisation des notes manquantes"""
# XXX E = sco_evaluation_db.do_evaluation_list({"evaluation_id": evaluation_id})[0]
# XXX M = sco_moduleimpl.moduleimpl_withmodule_list(moduleimpl_id=E["moduleimpl_id"])[0]
evaluation = Evaluation.query.get_or_404(evaluation_id) evaluation = Evaluation.query.get_or_404(evaluation_id)
modimpl = evaluation.moduleimpl modimpl = evaluation.moduleimpl
@ -357,19 +355,16 @@ def do_evaluation_set_missing(evaluation_id, value, dialog_confirmed=False):
comment = "Initialisation notes manquantes" comment = "Initialisation notes manquantes"
nb_changed, _, _ = notes_add(current_user, evaluation_id, L, comment) nb_changed, _, _ = notes_add(current_user, evaluation_id, L, comment)
# news # news
M = sco_moduleimpl.moduleimpl_list(moduleimpl_id=E["moduleimpl_id"])[0] url = url_for(
mod = sco_edit_module.module_list(args={"module_id": M["module_id"]})[0]
mod["moduleimpl_id"] = M["moduleimpl_id"]
mod["url"] = url_for(
"notes.moduleimpl_status", "notes.moduleimpl_status",
scodoc_dept=g.scodoc_dept, scodoc_dept=g.scodoc_dept,
moduleimpl_id=mod["moduleimpl_id"], moduleimpl_id=evaluation.moduleimpl_id,
) )
ScolarNews.add( ScolarNews.add(
typ=ScolarNews.NEWS_NOTE, typ=ScolarNews.NEWS_NOTE,
obj=M["moduleimpl_id"], obj=evaluation.moduleimpl_id,
text='Initialisation notes dans <a href="%(url)s">%(titre)s</a>' % mod, text=f"""Initialisation notes dans <a href="{url}">{modimpl.module.titre or ""}</a>""",
url=mod["url"], url=url,
max_frequency=30 * 60, max_frequency=30 * 60,
) )
return f""" return f"""