From 4d7349403d5fe5c3a5c89e51158aaaf6e9acefba Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Mon, 11 Apr 2022 08:03:27 +0200 Subject: [PATCH] typos --- app/comp/bonus_spo.py | 2 +- app/scodoc/sco_news.py | 14 ++++++-------- app/views/notes.py | 13 +++++++------ 3 files changed, 14 insertions(+), 15 deletions(-) diff --git a/app/comp/bonus_spo.py b/app/comp/bonus_spo.py index 416a0d0e..d4712098 100644 --- a/app/comp/bonus_spo.py +++ b/app/comp/bonus_spo.py @@ -1011,7 +1011,7 @@ class BonusTarbes(BonusSportAdditif): """ name = "bonus_tarbes" - displayed_name = "IUT de Tazrbes" + displayed_name = "IUT de Tarbes" seuil_moy_gen = 10.0 proportion_point = 1 / 30.0 classic_use_bonus_ues = True diff --git a/app/scodoc/sco_news.py b/app/scodoc/sco_news.py index e0977a95..a516ddba 100644 --- a/app/scodoc/sco_news.py +++ b/app/scodoc/sco_news.py @@ -112,7 +112,6 @@ def scolar_news_summary(n=5): """Return last n news. News are "compressed", ie redondant events are joined. """ - from app.scodoc import sco_etud from app.scodoc import sco_users cnx = ndb.GetDBConnexion() @@ -152,12 +151,12 @@ def scolar_news_summary(n=5): # date resumee j, m = n["date"].split("/")[:2] 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: infos = _get_formsemestre_infos_from_news(n) if infos: n["text"] += ( - ' (%(descr_sem)s)' + ' (%(descr_sem)s)' % infos ) n["text"] += ( @@ -179,21 +178,20 @@ def _get_formsemestre_infos_from_news(n): mods = sco_moduleimpl.moduleimpl_list(moduleimpl_id=moduleimpl_id) if not mods: return {} # module does not exists anymore - return {} # pas d'indication du module - mod = mods[0] - formsemestre_id = mod["formsemestre_id"] + mod = mods[0] + formsemestre_id = mod["formsemestre_id"] if not formsemestre_id: return {} try: sem = sco_formsemestre.get_formsemestre(formsemestre_id) - except: + except ValueError: # semestre n'existe plus return {} if sem["semestre_id"] > 0: - descr_sem = "S%d" % sem["semestre_id"] + descr_sem = f'S{sem["semestre_id"]}' else: descr_sem = "" if sem["modalite"]: diff --git a/app/views/notes.py b/app/views/notes.py index 82c45539..688811c0 100644 --- a/app/views/notes.py +++ b/app/views/notes.py @@ -1738,12 +1738,13 @@ def evaluation_listenotes(): evaluation_id = None moduleimpl_id = None vals = scu.get_request_args() - if "evaluation_id" in vals: - evaluation_id = int(vals["evaluation_id"]) - mode = "eval" - if "moduleimpl_id" in vals and vals["moduleimpl_id"]: - moduleimpl_id = int(vals["moduleimpl_id"]) - mode = "module" + try: + if "evaluation_id" in vals: + evaluation_id = int(vals["evaluation_id"]) + if "moduleimpl_id" in vals and vals["moduleimpl_id"]: + moduleimpl_id = int(vals["moduleimpl_id"]) + except ValueError as exc: + raise ScoValueError("adresse invalide !") from exc format = vals.get("format", "html") html_content, page_title = sco_liste_notes.do_evaluation_listenotes(