This commit is contained in:
Emmanuel Viennet 2022-04-11 08:03:27 +02:00
parent 4d257e63e8
commit 4d7349403d
3 changed files with 14 additions and 15 deletions

View File

@ -1011,7 +1011,7 @@ class BonusTarbes(BonusSportAdditif):
""" """
name = "bonus_tarbes" name = "bonus_tarbes"
displayed_name = "IUT de Tazrbes" displayed_name = "IUT de Tarbes"
seuil_moy_gen = 10.0 seuil_moy_gen = 10.0
proportion_point = 1 / 30.0 proportion_point = 1 / 30.0
classic_use_bonus_ues = True classic_use_bonus_ues = True

View File

@ -112,7 +112,6 @@ def scolar_news_summary(n=5):
"""Return last n news. """Return last n news.
News are "compressed", ie redondant events are joined. News are "compressed", ie redondant events are joined.
""" """
from app.scodoc import sco_etud
from app.scodoc import sco_users from app.scodoc import sco_users
cnx = ndb.GetDBConnexion() cnx = ndb.GetDBConnexion()
@ -152,12 +151,12 @@ def scolar_news_summary(n=5):
# date resumee # date resumee
j, m = n["date"].split("/")[:2] j, m = n["date"].split("/")[:2]
mois = scu.MONTH_NAMES_ABBREV[int(m) - 1] mois = scu.MONTH_NAMES_ABBREV[int(m) - 1]
n["formatted_date"] = "%s %s %s" % (j, mois, n["hm"]) n["formatted_date"] = f'{j} {mois} {n["hm"]}'
# indication semestre si ajout notes: # indication semestre si ajout notes:
infos = _get_formsemestre_infos_from_news(n) infos = _get_formsemestre_infos_from_news(n)
if infos: if infos:
n["text"] += ( n["text"] += (
' (<a href="Notes/formsemestre_status?formsemestre_id=%(formsemestre_id)s">%(descr_sem)s</a>)' ' (<a class="stdlink" href="Notes/formsemestre_status?formsemestre_id=%(formsemestre_id)s">%(descr_sem)s</a>)'
% infos % infos
) )
n["text"] += ( n["text"] += (
@ -179,21 +178,20 @@ def _get_formsemestre_infos_from_news(n):
mods = sco_moduleimpl.moduleimpl_list(moduleimpl_id=moduleimpl_id) mods = sco_moduleimpl.moduleimpl_list(moduleimpl_id=moduleimpl_id)
if not mods: if not mods:
return {} # module does not exists anymore return {} # module does not exists anymore
return {} # pas d'indication du module mod = mods[0]
mod = mods[0] formsemestre_id = mod["formsemestre_id"]
formsemestre_id = mod["formsemestre_id"]
if not formsemestre_id: if not formsemestre_id:
return {} return {}
try: try:
sem = sco_formsemestre.get_formsemestre(formsemestre_id) sem = sco_formsemestre.get_formsemestre(formsemestre_id)
except: except ValueError:
# semestre n'existe plus # semestre n'existe plus
return {} return {}
if sem["semestre_id"] > 0: if sem["semestre_id"] > 0:
descr_sem = "S%d" % sem["semestre_id"] descr_sem = f'S{sem["semestre_id"]}'
else: else:
descr_sem = "" descr_sem = ""
if sem["modalite"]: if sem["modalite"]:

View File

@ -1738,12 +1738,13 @@ def evaluation_listenotes():
evaluation_id = None evaluation_id = None
moduleimpl_id = None moduleimpl_id = None
vals = scu.get_request_args() vals = scu.get_request_args()
if "evaluation_id" in vals: try:
evaluation_id = int(vals["evaluation_id"]) if "evaluation_id" in vals:
mode = "eval" evaluation_id = int(vals["evaluation_id"])
if "moduleimpl_id" in vals and vals["moduleimpl_id"]: if "moduleimpl_id" in vals and vals["moduleimpl_id"]:
moduleimpl_id = int(vals["moduleimpl_id"]) moduleimpl_id = int(vals["moduleimpl_id"])
mode = "module" except ValueError as exc:
raise ScoValueError("adresse invalide !") from exc
format = vals.get("format", "html") format = vals.get("format", "html")
html_content, page_title = sco_liste_notes.do_evaluation_listenotes( html_content, page_title = sco_liste_notes.do_evaluation_listenotes(