From 38d7f31408e456d71abdd722465459cd20f39816 Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Thu, 10 Feb 2022 14:34:16 +0100 Subject: [PATCH] Fix (bul BUT) --- app/but/bulletin_but.py | 10 ++++++---- app/comp/res_common.py | 2 -- app/scodoc/notes_table.py | 4 ++-- app/scodoc/sco_recapcomplet.py | 2 +- app/views/notes.py | 2 +- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/app/but/bulletin_but.py b/app/but/bulletin_but.py index 70a83a5b5..2f1637fbb 100644 --- a/app/but/bulletin_but.py +++ b/app/but/bulletin_but.py @@ -123,7 +123,8 @@ class BulletinBUT: # np.nanmean(self.sem_cube[:, mod_idx, :], axis=1), # copy=False, # ) - # except RuntimeWarning: # all nans in np.nanmean (sur certains etuds sans notes valides) + # except RuntimeWarning: + # # all nans in np.nanmean (sur certains etuds sans notes valides) # pass # try: # moy_indicative_mod = np.nanmean(self.sem_cube[etud_idx, mod_idx]) @@ -141,7 +142,8 @@ class BulletinBUT: moduleimpl_id=modimpl.id, ), "moyenne": { - # # moyenne indicative de module: moyenne des UE, ignorant celles sans notes (nan) + # # moyenne indicative de module: moyenne des UE, + # # ignorant celles sans notes (nan) # "value": fmt_note(moy_indicative_mod), # "min": fmt_note(moyennes_etuds.min()), # "max": fmt_note(moyennes_etuds.max()), @@ -216,7 +218,7 @@ class BulletinBUT: """ res = self.res etat_inscription = etud.etat_inscription(formsemestre.id) - nb_inscrits = self.get_inscriptions_counts()[scu.INSCRIT] + nb_inscrits = self.res.get_inscriptions_counts()[scu.INSCRIT] published = (not formsemestre.bul_hide_xml) or force_publishing d = { "version": "0", @@ -276,7 +278,7 @@ class BulletinBUT: "ues": { ue.acronyme: self.etud_ue_results(etud, ue) for ue in res.ues - if self.modimpls_in_ue( + if self.res.modimpls_in_ue( ue.id, etud.id ) # si l'UE comporte des modules auxquels on est inscrit }, diff --git a/app/comp/res_common.py b/app/comp/res_common.py index ea17bb14a..616ddb719 100644 --- a/app/comp/res_common.py +++ b/app/comp/res_common.py @@ -9,8 +9,6 @@ from functools import cached_property import numpy as np import pandas as pd -from flask import g - from app.comp.aux_stats import StatsMoyenne from app.comp import moy_sem from app.comp.res_cache import ResultatsCache diff --git a/app/scodoc/notes_table.py b/app/scodoc/notes_table.py index d4db93382..d014d9faf 100644 --- a/app/scodoc/notes_table.py +++ b/app/scodoc/notes_table.py @@ -410,7 +410,7 @@ class NotesTable: return "" def get_etud_etat_html(self, etudid): - + etat = self.inscrdict[etudid]["etat"] if etat == "I": return "" elif etat == "D": @@ -1169,7 +1169,7 @@ class NotesTable: and moy_ue_cap >= self.parcours.NOTES_BARRE_VALID_UE ): if not cnx: - cnx = ndb.GetDBConnexion(autocommit=False) + cnx = ndb.GetDBConnexion() sco_parcours_dut.do_formsemestre_validate_ue( cnx, nt_cap, diff --git a/app/scodoc/sco_recapcomplet.py b/app/scodoc/sco_recapcomplet.py index fa569e5ca..3b87f8f58 100644 --- a/app/scodoc/sco_recapcomplet.py +++ b/app/scodoc/sco_recapcomplet.py @@ -495,7 +495,7 @@ def make_formsemestre_recapcomplet( j += 1 if not hidebac: for k in admission_extra_cols: - l.append(getattr(e["admission"], k, "")) + l.append(getattr(e["admission"], k, "") or "") l.append( nt.identdict[etudid]["code_nip"] or "" ) # avant-derniere colonne = code_nip diff --git a/app/views/notes.py b/app/views/notes.py index 0762a5cee..afd7b855c 100644 --- a/app/views/notes.py +++ b/app/views/notes.py @@ -133,7 +133,7 @@ from app.scodoc.TrivialFormulator import TrivialFormulator from app.views import ScoData -def sco_publish(route, function, permission, methods=["GET"]): +def sco_publish(route, function, permission, methods=("GET",)): """Declare a route for a python function, protected by permission and called following ScoDoc 7 Zope standards. """