Fix: invalidation cache sur modif evaluation

This commit is contained in:
Emmanuel Viennet 2023-11-14 22:48:28 +01:00
parent e551ac5124
commit a043cb26ed
3 changed files with 26 additions and 4 deletions

View File

@ -45,6 +45,7 @@ from app.scodoc.sco_utils import ModuleType
from app.scodoc.sco_exceptions import ScoValueError from app.scodoc.sco_exceptions import ScoValueError
from app.scodoc.TrivialFormulator import TrivialFormulator from app.scodoc.TrivialFormulator import TrivialFormulator
from app.scodoc import html_sco_header from app.scodoc import html_sco_header
from app.scodoc import sco_cache
from app.scodoc import sco_evaluations from app.scodoc import sco_evaluations
from app.scodoc import sco_moduleimpl from app.scodoc import sco_moduleimpl
from app.scodoc import sco_preferences from app.scodoc import sco_preferences
@ -87,7 +88,7 @@ def evaluation_create_form(
{html_sco_header.sco_header()} {html_sco_header.sco_header()}
<h2>Opération non autorisée</h2> <h2>Opération non autorisée</h2>
<p>Modification évaluation impossible pour {current_user.get_nomplogin()}</p> <p>Modification évaluation impossible pour {current_user.get_nomplogin()}</p>
<p><a href="{url_for('notes.moduleimpl_status', <p><a href="{url_for('notes.moduleimpl_status',
scodoc_dept=g.scodoc_dept, moduleimpl_id=moduleimpl_id) scodoc_dept=g.scodoc_dept, moduleimpl_id=moduleimpl_id)
}" class="stdlink">Revenir</a> }" class="stdlink">Revenir</a>
</p> </p>
@ -131,7 +132,7 @@ def evaluation_create_form(
H = [ H = [
f"""<h3>{action} en f"""<h3>{action} en
{scu.MODULE_TYPE_NAMES[mod["module_type"]]} <a class="stdlink" href="{ {scu.MODULE_TYPE_NAMES[mod["module_type"]]} <a class="stdlink" href="{
url_for("notes.moduleimpl_status", url_for("notes.moduleimpl_status",
scodoc_dept=g.scodoc_dept, moduleimpl_id=moduleimpl_id) scodoc_dept=g.scodoc_dept, moduleimpl_id=moduleimpl_id)
}">{mod["code"] or "module sans code"} {mod["titre"]}</a> {link}</h3> }">{mod["code"] or "module sans code"} {mod["titre"]}</a> {link}</h3>
""" """
@ -299,7 +300,7 @@ def evaluation_create_form(
"type": "float", "type": "float",
"explanation": f""" "explanation": f"""
<span class="eval_coef_ue" title="coef. du module dans cette UE">({ <span class="eval_coef_ue" title="coef. du module dans cette UE">({
"coef. mod.:" +str(coef_ue) if coef_ue "coef. mod.:" +str(coef_ue) if coef_ue
else "ce module n'a pas de coef. dans cette UE" else "ce module n'a pas de coef. dans cette UE"
})</span> })</span>
<span class="eval_coef_ue_titre">{ue.titre}</span> <span class="eval_coef_ue_titre">{ue.titre}</span>
@ -382,4 +383,5 @@ def evaluation_create_form(
evaluation.set_ue_poids(ue, tf[2][f"poids_{ue.id}"]) evaluation.set_ue_poids(ue, tf[2][f"poids_{ue.id}"])
db.session.add(evaluation) db.session.add(evaluation)
db.session.commit() db.session.commit()
sco_cache.invalidate_formsemestre(evaluation.moduleimpl.formsemestre.id)
return flask.redirect(dest_url) return flask.redirect(dest_url)

View File

@ -23,5 +23,12 @@
height: calc(100% - 44px) !important; height: calc(100% - 44px) !important;
} }
.toastui-calendar-week-view-day-names, .toastui-calendar-time { .toastui-calendar-week-view-day-names, .toastui-calendar-time {
overflow: hidden !important; overflow: hidden !important;
}
.ic-arrow-line-left {
background: url('../icons/ic-arrow-line-left.png') no-repeat;
}
.ic-arrow-line-right {
background: url('../icons/ic-arrow-line-right.png') no-repeat;
} }

View File

@ -13,6 +13,19 @@
<div class="tab-content"> <div class="tab-content">
<h2>Expérimental: emploi du temps</h2> <h2>Expérimental: emploi du temps</h2>
<div>
<span id="menu-navi">
<button type="button" class="btn btn-default btn-sm move-today"
data-action="move-today">Aujourd'hui</button>
<button type="button" class="btn btn-default btn-sm move-day" data-action="move-prev">
<i class="calendar-icon ic-arrow-line-left" data-action="move-prev"></i>
</button>
<button type="button" class="btn btn-default btn-sm move-day" data-action="move-next">
<i class="calendar-icon ic-arrow-line-right" data-action="move-next"></i>
</button>
</span>
<span id="renderRange" class="render-range"></span>
</div>
<div id="calendar" style="height: calc(100vh - 180px);"></div> <div id="calendar" style="height: calc(100vh - 180px);"></div>
</div> </div>