forked from ScoDoc/ScoDoc
PV de jury (et lettres): listes les validations d'UE antérieures. Closes #946
This commit is contained in:
parent
34aab0a46f
commit
668eeb8e3f
@ -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]
|
||||
# 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]:
|
||||
|
@ -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
|
||||
|
@ -806,7 +806,7 @@ def formsemestre_recap_parcours_table(
|
||||
H.append(
|
||||
f"""<td class="sem_ects_tit"><a title="crédit acquis">ECTS:</a></td>
|
||||
<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 class="rcp_abs"></td>
|
||||
"""
|
||||
@ -819,7 +819,7 @@ def formsemestre_recap_parcours_table(
|
||||
ects_pot = ue_status["ects_pot"]
|
||||
H.append(
|
||||
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:
|
||||
H.append("""<td class="ue"></td>""")
|
||||
|
@ -1,7 +1,7 @@
|
||||
# -*- mode: python -*-
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
SCOVERSION = "9.6.981"
|
||||
SCOVERSION = "9.6.982"
|
||||
|
||||
SCONAME = "ScoDoc"
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user