Update opolka/ScoDoc from ScoDoc/ScoDoc #2

Merged
opolka merged 1272 commits from ScoDoc/ScoDoc:master into master 2024-05-27 09:11:04 +02:00
2 changed files with 18 additions and 10 deletions
Showing only changes of commit d1d89cc427 - Show all commits

View File

@ -55,7 +55,7 @@ from app.models import (
ScoDocSiteConfig, ScoDocSiteConfig,
) )
from app.scodoc.sco_permissions import Permission from app.scodoc.sco_permissions import Permission
from app.scodoc.sco_exceptions import AccessDenied, ScoValueError from app.scodoc.sco_exceptions import AccessDenied, ScoValueError, ScoTemporaryError
from app.scodoc import html_sco_header from app.scodoc import html_sco_header
from app.scodoc import htmlutils from app.scodoc import htmlutils
from app.scodoc import sco_assiduites from app.scodoc import sco_assiduites
@ -346,14 +346,14 @@ def formsemestre_bulletinetud_dict(formsemestre_id, etudid, version="long"):
# auparavant on filtrait les modules sans notes # auparavant on filtrait les modules sans notes
# si ue_status['cur_moy_ue'] != 'NA' alors u['modules'] = [] (pas de moyenne => pas de modules) # si ue_status['cur_moy_ue'] != 'NA' alors u['modules'] = [] (pas de moyenne => pas de modules)
u[ u["modules_capitalized"] = (
"modules_capitalized" []
] = [] # modules de l'UE capitalisée (liste vide si pas capitalisée) ) # modules de l'UE capitalisée (liste vide si pas capitalisée)
if ue_status["is_capitalized"] and ue_status["formsemestre_id"] is not None: if ue_status["is_capitalized"] and ue_status["formsemestre_id"] is not None:
sem_origin = db.session.get(FormSemestre, ue_status["formsemestre_id"]) sem_origin = db.session.get(FormSemestre, ue_status["formsemestre_id"])
u[ u["ue_descr_txt"] = (
"ue_descr_txt" f'capitalisée le {ndb.DateISOtoDMY(ue_status["event_date"])}'
] = f'capitalisée le {ndb.DateISOtoDMY(ue_status["event_date"])}' )
u["ue_descr_html"] = ( u["ue_descr_html"] = (
f"""<a href="{ url_for( 'notes.formsemestre_bulletinetud', f"""<a href="{ url_for( 'notes.formsemestre_bulletinetud',
scodoc_dept=g.scodoc_dept, formsemestre_id=sem_origin.id, etudid=etudid)}" scodoc_dept=g.scodoc_dept, formsemestre_id=sem_origin.id, etudid=etudid)}"
@ -731,7 +731,11 @@ def etud_descr_situation_semestre(
infos["refcomp_specialite_long"] = "" infos["refcomp_specialite_long"] = ""
if formsemestre.formation.is_apc(): if formsemestre.formation.is_apc():
res: ResultatsSemestreBUT = res_sem.load_formsemestre_results(formsemestre) res: ResultatsSemestreBUT = res_sem.load_formsemestre_results(formsemestre)
try:
parcour_id = res.etuds_parcour_id[etudid] parcour_id = res.etuds_parcour_id[etudid]
except KeyError as exc:
log("sco_bulletins: ScoTemporaryError 240222")
raise ScoTemporaryError() from exc
parcour: ApcParcours = ( parcour: ApcParcours = (
db.session.get(ApcParcours, parcour_id) if parcour_id is not None else None db.session.get(ApcParcours, parcour_id) if parcour_id is not None else None
) )

View File

@ -28,6 +28,7 @@
"""Exception handling """Exception handling
""" """
from flask_login import current_user from flask_login import current_user
import app
# --- Exceptions # --- Exceptions
@ -237,8 +238,11 @@ class ScoTemporaryError(ScoValueError):
def __init__(self, msg: str = ""): def __init__(self, msg: str = ""):
msg = """ msg = """
<p>"Erreur temporaire</p> <p>Erreur temporaire</p>
<p>Veuillez -essayer. Si le problème persiste, merci de contacter l'assistance ScoDoc <p>Veuillez -essayer. Si le problème persiste (ou s'il venait
à se produire fréquemment), merci de contacter l'assistance ScoDoc
(voir <a href="https://scodoc.org/Contact/">les informations de contact</a>).
</p> </p>
""" """
app.clear_scodoc_cache()
super().__init__(msg) super().__init__(msg)