From 668eeb8e3f6c12d7c12328ebfed827e78017b9b9 Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Wed, 26 Jun 2024 22:24:10 +0200 Subject: [PATCH] =?UTF-8?q?PV=20de=20jury=20(et=20lettres):=20listes=20les?= =?UTF-8?q?=20validations=20d'UE=20ant=C3=A9rieures.=20Closes=20#946?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/but/jury_but.py | 38 ++++++++++++++++++++++- app/but/jury_but_pv.py | 2 +- app/scodoc/sco_formsemestre_validation.py | 4 +-- sco_version.py | 2 +- 4 files changed, 41 insertions(+), 5 deletions(-) diff --git a/app/but/jury_but.py b/app/but/jury_but.py index 8c19239f..1598d0c8 100644 --- a/app/but/jury_but.py +++ b/app/but/jury_but.py @@ -64,6 +64,7 @@ import re import numpy as np from flask import flash, g, url_for +import sqlalchemy as sa from app import db from app import log @@ -83,6 +84,7 @@ from app.models.but_validations import ( ApcValidationRCUE, ) from app.models.etudiants import Identite +from app.models.formations import Formation from app.models.formsemestre import FormSemestre from app.models.ues import UniteEns from app.models.validations import ScolarFormSemestreValidation @@ -90,6 +92,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, + code_ue_validant, BUT_CODES_ORDER, CODES_RCUE_VALIDES, CODES_UE_VALIDES, @@ -986,6 +989,36 @@ class DecisionsProposeesAnnee(DecisionsProposees): pour PV jurys """ validations = [] + # Validations antérieures émises par ce formsemestre + for res in (self.res_impair, self.res_pair): + if res: + validations_anterieures = ( + ScolarFormSemestreValidation.query.filter_by( + etudid=self.etud.id, formsemestre_id=res.formsemestre.id + ) + .filter( + ScolarFormSemestreValidation.semestre_id + != res.formsemestre.semestre_id + ) + .join(UniteEns) + .join(Formation) + .filter_by(formation_code=res.formsemestre.formation.formation_code) + .order_by( + sa.desc(UniteEns.semestre_idx), + UniteEns.acronyme, + sa.desc(ScolarFormSemestreValidation.event_date), + ) + .all() + ) + if validations_anterieures: + validations.append( + ", ".join( + v.ue.acronyme + for v in validations_anterieures + if v and v.ue and code_ue_validant(v.code) + ) + ) + # Validations des UEs des deux semestres de l'année for res in (self.res_impair, self.res_pair): if res: dec_ues = [ @@ -994,7 +1027,10 @@ class DecisionsProposeesAnnee(DecisionsProposees): if ue.type == UE_STANDARD and ue.id in self.decisions_ues ] valids = [dec_ue.descr_validation() for dec_ue in dec_ues] - validations.append(", ".join(v for v in valids if v)) + # présentation de la liste des UEs: + if valids: + validations.append(", ".join(v for v in valids if v)) + return line_sep.join(validations) def descr_pb_coherence(self) -> list[str]: diff --git a/app/but/jury_but_pv.py b/app/but/jury_but_pv.py index c20000fb..22aca962 100644 --- a/app/but/jury_but_pv.py +++ b/app/but/jury_but_pv.py @@ -8,7 +8,7 @@ """ from flask import g, request, url_for -from openpyxl.styles import Font, Border, Side, Alignment, PatternFill +from openpyxl.styles import Alignment from app import log from app.but import jury_but diff --git a/app/scodoc/sco_formsemestre_validation.py b/app/scodoc/sco_formsemestre_validation.py index 988f0e9e..3b3fa3b5 100644 --- a/app/scodoc/sco_formsemestre_validation.py +++ b/app/scodoc/sco_formsemestre_validation.py @@ -806,7 +806,7 @@ def formsemestre_recap_parcours_table( H.append( f"""ECTS: { - pv.get("sum_ects",0):2.2g} / {etud_ects_infos["ects_total"]:2.2g} + pv.get("sum_ects",0):2.3g} / {etud_ects_infos["ects_total"]:2.3g} """ @@ -819,7 +819,7 @@ def formsemestre_recap_parcours_table( ects_pot = ue_status["ects_pot"] H.append( f"""{ects:2.2g}""" + title="{ects:2.3g}/{ects_pot:2.3g} ECTS">{ects:2.3g}""" ) else: H.append("""""") diff --git a/sco_version.py b/sco_version.py index 0b5fefee..5e4aa92a 100644 --- a/sco_version.py +++ b/sco_version.py @@ -1,7 +1,7 @@ # -*- mode: python -*- # -*- coding: utf-8 -*- -SCOVERSION = "9.6.981" +SCOVERSION = "9.6.982" SCONAME = "ScoDoc"