From 4b7297bf1e854930c8c57f5f82a993a35962bffa Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Thu, 10 Feb 2022 15:29:51 +0100 Subject: [PATCH] moduleimpl_status sans nt --- app/scodoc/notes_table.py | 2 +- app/scodoc/sco_moduleimpl_status.py | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/app/scodoc/notes_table.py b/app/scodoc/notes_table.py index d014d9faf..a9aaf7e16 100644 --- a/app/scodoc/notes_table.py +++ b/app/scodoc/notes_table.py @@ -171,7 +171,7 @@ class NotesTable: def __init__(self, formsemestre_id): # log(f"NotesTable( formsemestre_id={formsemestre_id} )") - # raise NotImplementedError() # XXX + raise NotImplementedError() # XXX if not formsemestre_id: raise ValueError("invalid formsemestre_id (%s)" % formsemestre_id) self.formsemestre_id = formsemestre_id diff --git a/app/scodoc/sco_moduleimpl_status.py b/app/scodoc/sco_moduleimpl_status.py index 700115e52..d3b6fbd95 100644 --- a/app/scodoc/sco_moduleimpl_status.py +++ b/app/scodoc/sco_moduleimpl_status.py @@ -33,10 +33,14 @@ from flask import g, url_for from flask_login import current_user from app.auth.models import User +from app.comp import res_sem +from app.comp.res_common import NotesTableCompat +from app.models import FormSemestre from app.models import ModuleImpl from app.models.evaluations import Evaluation import app.scodoc.sco_utils as scu from app.scodoc.sco_exceptions import ScoInvalidIdType +from app.scodoc.sco_parcours_dut import formsemestre_has_decisions from app.scodoc.sco_permissions import Permission from app.scodoc import html_sco_header @@ -199,7 +203,9 @@ def moduleimpl_status(moduleimpl_id=None, partition_id=None): moduleimpl_id=M["moduleimpl_id"] ) - nt = sco_cache.NotesTableCache.get(formsemestre_id) + # nt = sco_cache.NotesTableCache.get(formsemestre_id) + nt: NotesTableCompat = res_sem.load_formsemestre_results(modimpl.formsemestre) + mod_evals = sco_evaluation_db.do_evaluation_list({"moduleimpl_id": moduleimpl_id}) mod_evals.sort( key=lambda x: (x["numero"], x["jour"], x["heure_debut"]), reverse=True @@ -335,7 +341,7 @@ def moduleimpl_status(moduleimpl_id=None, partition_id=None): if has_expression and nt.expr_diagnostics: H.append(sco_formsemestre_status.html_expr_diagnostic(nt.expr_diagnostics)) # - if nt.sem_has_decisions(): + if formsemestre_has_decisions(formsemestre_id): H.append( """""" )