From 1a3ee5864d74c2772617a61be2955a28c1a81f13 Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Fri, 11 Feb 2022 09:11:07 +0100 Subject: [PATCH] Fix: pe sans nt --- app/pe/pe_jurype.py | 10 +++++++--- app/pe/pe_semestretag.py | 13 +++++++++---- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/app/pe/pe_jurype.py b/app/pe/pe_jurype.py index 694a410f..71ee98c6 100644 --- a/app/pe/pe_jurype.py +++ b/app/pe/pe_jurype.py @@ -46,9 +46,12 @@ import io import os from zipfile import ZipFile +from app.comp import res_sem +from app.comp.res_common import NotesTableCompat +from app.models import FormSemestre + from app.scodoc.gen_tables import GenTable, SeqGenTable import app.scodoc.sco_utils as scu -from app.scodoc import sco_cache from app.scodoc import sco_codes_parcours # sco_codes_parcours.NEXT -> sem suivant from app.scodoc import sco_etud from app.scodoc import sco_formsemestre @@ -1127,9 +1130,10 @@ class JuryPE(object): # ------------------------------------------------------------------------------------------------------------------ # ------------------------------------------------------------------------------------------------------------------ - def get_cache_notes_d_un_semestre(self, formsemestre_id): # inutile en realité ! + def get_cache_notes_d_un_semestre(self, formsemestre_id: int) -> NotesTableCompat: """Charge la table des notes d'un formsemestre""" - return sco_cache.NotesTableCache.get(formsemestre_id) + formsemestre = FormSemestre.query.get_or_404(formsemestre_id) + nt: NotesTableCompat = res_sem.load_formsemestre_results(formsemestre) # ------------------------------------------------------------------------------------------------------------------ diff --git a/app/pe/pe_semestretag.py b/app/pe/pe_semestretag.py index 695bbe5e..369fe25d 100644 --- a/app/pe/pe_semestretag.py +++ b/app/pe/pe_semestretag.py @@ -37,9 +37,12 @@ Created on Fri Sep 9 09:15:05 2016 """ from app import log +from app.comp import res_sem +from app.comp.res_common import NotesTableCompat +from app.models import FormSemestre + from app.models.ues import UniteEns from app.scodoc import sco_codes_parcours -from app.scodoc import sco_cache from app.scodoc import sco_tag_module from app.pe import pe_tagtable @@ -267,9 +270,11 @@ class SemestreTag(pe_tagtable.TableTag): # => le formsemestre_id du semestre dont vient la capitalisation fid_prec = fids_prec[0] # Lecture des notes de ce semestre - nt_prec = sco_cache.NotesTableCache.get( - fid_prec - ) # le tableau de note du semestre considéré + # le tableau de note du semestre considéré: + formsemestre_prec = FormSemestre.query.get_or_404(fid_prec) + nt_prec: NotesTableCompat = res_sem.load_formsemestre_results( + formsemestre_prec + ) # Y-a-t-il un module équivalent c'est à dire correspondant au même code (le module_id n'étant pas significatif en cas de changement de PPN) modimpl_prec = [