1
0
forked from ScoDoc/ScoDoc

PV de jury (et lettres): listes les validations d'UE antérieures. Closes #946

This commit is contained in:
Emmanuel Viennet 2024-06-26 22:24:10 +02:00
parent 34aab0a46f
commit 668eeb8e3f
4 changed files with 41 additions and 5 deletions

View File

@ -64,6 +64,7 @@ import re
import numpy as np import numpy as np
from flask import flash, g, url_for from flask import flash, g, url_for
import sqlalchemy as sa
from app import db from app import db
from app import log from app import log
@ -83,6 +84,7 @@ from app.models.but_validations import (
ApcValidationRCUE, ApcValidationRCUE,
) )
from app.models.etudiants import Identite from app.models.etudiants import Identite
from app.models.formations import Formation
from app.models.formsemestre import FormSemestre from app.models.formsemestre import FormSemestre
from app.models.ues import UniteEns from app.models.ues import UniteEns
from app.models.validations import ScolarFormSemestreValidation 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 import codes_cursus as sco_codes
from app.scodoc.codes_cursus import ( from app.scodoc.codes_cursus import (
code_rcue_validant, code_rcue_validant,
code_ue_validant,
BUT_CODES_ORDER, BUT_CODES_ORDER,
CODES_RCUE_VALIDES, CODES_RCUE_VALIDES,
CODES_UE_VALIDES, CODES_UE_VALIDES,
@ -986,6 +989,36 @@ class DecisionsProposeesAnnee(DecisionsProposees):
pour PV jurys pour PV jurys
""" """
validations = [] 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): for res in (self.res_impair, self.res_pair):
if res: if res:
dec_ues = [ dec_ues = [
@ -994,7 +1027,10 @@ class DecisionsProposeesAnnee(DecisionsProposees):
if ue.type == UE_STANDARD and ue.id in self.decisions_ues if ue.type == UE_STANDARD and ue.id in self.decisions_ues
] ]
valids = [dec_ue.descr_validation() for dec_ue in dec_ues] valids = [dec_ue.descr_validation() for dec_ue in dec_ues]
# présentation de la liste des UEs:
if valids:
validations.append(", ".join(v for v in valids if v)) validations.append(", ".join(v for v in valids if v))
return line_sep.join(validations) return line_sep.join(validations)
def descr_pb_coherence(self) -> list[str]: def descr_pb_coherence(self) -> list[str]:

View File

@ -8,7 +8,7 @@
""" """
from flask import g, request, url_for 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 import log
from app.but import jury_but from app.but import jury_but

View File

@ -806,7 +806,7 @@ def formsemestre_recap_parcours_table(
H.append( H.append(
f"""<td class="sem_ects_tit"><a title="crédit acquis">ECTS:</a></td> f"""<td class="sem_ects_tit"><a title="crédit acquis">ECTS:</a></td>
<td class="sem_ects">{ <td class="sem_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}
</td> </td>
<td class="rcp_abs"></td> <td class="rcp_abs"></td>
""" """
@ -819,7 +819,7 @@ def formsemestre_recap_parcours_table(
ects_pot = ue_status["ects_pot"] ects_pot = ue_status["ects_pot"]
H.append( H.append(
f"""<td class="ue" f"""<td class="ue"
title="{ects:2.2g}/{ects_pot:2.2g} ECTS">{ects:2.2g}</td>""" title="{ects:2.3g}/{ects_pot:2.3g} ECTS">{ects:2.3g}</td>"""
) )
else: else:
H.append("""<td class="ue"></td>""") H.append("""<td class="ue"></td>""")

View File

@ -1,7 +1,7 @@
# -*- mode: python -*- # -*- mode: python -*-
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
SCOVERSION = "9.6.981" SCOVERSION = "9.6.982"
SCONAME = "ScoDoc" SCONAME = "ScoDoc"