From c45abc33cc7d782599cf2202a293a661bfd1aa31 Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Thu, 22 Jun 2023 08:22:37 +0200 Subject: [PATCH] =?UTF-8?q?Modification=20priorit=C3=A9=20codes=20jury:=20?= =?UTF-8?q?PASD=20>=20PAS1NCI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/but/cursus_but.py | 14 +++++++------- app/but/jury_but.py | 10 +++++----- app/but/jury_but_view.py | 4 ++-- app/comp/res_but.py | 4 ++-- app/scodoc/codes_cursus.py | 6 +++--- app/scodoc/sco_moduleimpl_inscriptions.py | 2 +- 6 files changed, 20 insertions(+), 20 deletions(-) diff --git a/app/but/cursus_but.py b/app/but/cursus_but.py index d8ca17e15..ea1b956ee 100644 --- a/app/but/cursus_but.py +++ b/app/but/cursus_but.py @@ -129,8 +129,8 @@ class EtudCursusBUT: ).get(validation_rcue.annee()) # prend la "meilleure" validation if (not previous_validation) or ( - sco_codes.BUT_CODES_ORDERED[validation_rcue.code] - > sco_codes.BUT_CODES_ORDERED[previous_validation.code] + sco_codes.BUT_CODES_ORDER[validation_rcue.code] + > sco_codes.BUT_CODES_ORDER[previous_validation.code] ): self.validation_par_competence_et_annee[niveau.competence.id][ niveau.annee @@ -200,7 +200,7 @@ class EtudCursusBUT: validations_by_niveau[validation_rcue.niveau().id].append(validation_rcue) validation_by_niveau = { niveau_id: sorted( - validations, key=lambda v: sco_codes.BUT_CODES_ORDERED[v.code] + validations, key=lambda v: sco_codes.BUT_CODES_ORDER[v.code] )[0] for niveau_id, validations in validations_by_niveau.items() if validations @@ -304,8 +304,8 @@ class FormSemestreCursusBUT: ).get(validation_rcue.annee()) # prend la "meilleure" validation if (not previous_validation) or ( - sco_codes.BUT_CODES_ORDERED[validation_rcue.code] - > sco_codes.BUT_CODES_ORDERED[previous_validation["code"]] + sco_codes.BUT_CODES_ORDER[validation_rcue.code] + > sco_codes.BUT_CODES_ORDER[previous_validation["code"]] ): self.validation_par_competence_et_annee[niveau.competence.id][ niveau.annee @@ -341,8 +341,8 @@ class FormSemestreCursusBUT: ).get(validation_rcue.annee()) # prend la "meilleure" validation if (not previous_validation) or ( - sco_codes.BUT_CODES_ORDERED[validation_rcue.code] - > sco_codes.BUT_CODES_ORDERED[previous_validation["code"]] + sco_codes.BUT_CODES_ORDER[validation_rcue.code] + > sco_codes.BUT_CODES_ORDER[previous_validation["code"]] ): self.validation_par_competence_et_annee[niveau.competence.id][ niveau.annee diff --git a/app/but/jury_but.py b/app/but/jury_but.py index 64c05b793..dedb522b9 100644 --- a/app/but/jury_but.py +++ b/app/but/jury_but.py @@ -94,7 +94,7 @@ from app.scodoc import sco_cache from app.scodoc import codes_cursus as sco_codes from app.scodoc.codes_cursus import ( code_rcue_validant, - BUT_CODES_ORDERED, + BUT_CODES_ORDER, CODES_RCUE_VALIDES, CODES_UE_CAPITALISANTS, CODES_UE_VALIDES, @@ -878,8 +878,8 @@ class DecisionsProposeesAnnee(DecisionsProposees): (not dec_rcue.recorded) and ( # enregistre seulement si pas déjà validé "mieux" (not dec_rcue.validation) - or BUT_CODES_ORDERED.get(dec_rcue.validation.code, 0) - < BUT_CODES_ORDERED.get(code, 0) + or BUT_CODES_ORDER.get(dec_rcue.validation.code, 0) + < BUT_CODES_ORDER.get(code, 0) ) and ( # décision validante de droit ? ( @@ -1121,9 +1121,9 @@ class DecisionsProposeesRCUE(DecisionsProposees): code_default = self.codes[0] if self.code_valide in self.codes: self.codes.remove(self.code_valide) - if sco_codes.BUT_CODES_ORDERED.get( + if sco_codes.BUT_CODES_ORDER.get( self.code_valide, 0 - ) > sco_codes.BUT_CODES_ORDERED.get(code_default, 0): + ) > sco_codes.BUT_CODES_ORDER.get(code_default, 0): self.codes.insert(0, self.code_valide) else: self.codes.insert(1, self.code_valide) diff --git a/app/but/jury_but_view.py b/app/but/jury_but_view.py index 8775b8bb8..bbe992cbf 100644 --- a/app/but/jury_but_view.py +++ b/app/but/jury_but_view.py @@ -253,8 +253,8 @@ def _gen_but_rcue(dec_rcue: DecisionsProposeesRCUE, niveau: ApcNiveau) -> str: descr_validation = f"""Décision recommandée: {dec_rcue.codes[0]}. Il y avait {dec_rcue.validation.html()}""" if ( - sco_codes.BUT_CODES_ORDERED[dec_rcue.codes[0]] - > sco_codes.BUT_CODES_ORDERED[dec_rcue.code_valide] + sco_codes.BUT_CODES_ORDER[dec_rcue.codes[0]] + > sco_codes.BUT_CODES_ORDER[dec_rcue.code_valide] ): code_propose_menu = dec_rcue.codes[0] scoplement = f"""
{descr_validation}
""" diff --git a/app/comp/res_but.py b/app/comp/res_but.py index 2c60f24a0..163d56f1d 100644 --- a/app/comp/res_but.py +++ b/app/comp/res_but.py @@ -20,7 +20,7 @@ from app.models.but_refcomp import ApcParcours, ApcNiveau from app.models.ues import DispenseUE, UniteEns from app.models.but_validations import ApcValidationAnnee, ApcValidationRCUE from app.scodoc import sco_preferences -from app.scodoc.codes_cursus import BUT_CODES_ORDERED, UE_SPORT +from app.scodoc.codes_cursus import BUT_CODES_ORDER, UE_SPORT from app.scodoc.sco_utils import ModuleType @@ -353,7 +353,7 @@ class ResultatsSemestreBUT(NotesTableCompat): for validation in validations: if validation.etudid in validation_by_etud: # keep the "best" - if BUT_CODES_ORDERED.get(validation.code, 0) > BUT_CODES_ORDERED.get( + if BUT_CODES_ORDER.get(validation.code, 0) > BUT_CODES_ORDER.get( validation_by_etud[validation.etudid].code, 0 ): validation_by_etud[validation.etudid] = validation diff --git a/app/scodoc/codes_cursus.py b/app/scodoc/codes_cursus.py index 6c4336a42..f5027eee1 100644 --- a/app/scodoc/codes_cursus.py +++ b/app/scodoc/codes_cursus.py @@ -222,15 +222,15 @@ BUT_CODES_PASSAGE = { } # les codes, du plus "défavorable" à l'étudiant au plus favorable: # (valeur par défaut 0) -BUT_CODES_ORDERED = { +BUT_CODES_ORDER = { NAR: 0, DEF: 0, AJ: 10, ATJ: 20, CMP: 50, ADC: 50, - PASD: 50, - PAS1NCI: 60, + PAS1NCI: 50, + PASD: 60, ADJR: 90, ADSUP: 90, ADJ: 100, diff --git a/app/scodoc/sco_moduleimpl_inscriptions.py b/app/scodoc/sco_moduleimpl_inscriptions.py index 03217dc7a..9cb7bf69b 100644 --- a/app/scodoc/sco_moduleimpl_inscriptions.py +++ b/app/scodoc/sco_moduleimpl_inscriptions.py @@ -581,7 +581,7 @@ def _list_but_ue_inscriptions(res: NotesTableCompat, read_only: bool = True) -> .all() ) validations_ue.sort( - key=lambda v: codes_cursus.BUT_CODES_ORDERED.get(v.code, 0) + key=lambda v: codes_cursus.BUT_CODES_ORDER.get(v.code, 0) ) validation = validations_ue[-1] if validations_ue else None expl_validation = (