forked from ScoDoc/ScoDoc
Fix: API bul JSON classic cap (...)
This commit is contained in:
parent
389f573351
commit
b9f3f84857
@ -201,11 +201,15 @@ class Formation(db.Model):
|
||||
|
||||
def query_ues_parcour(self, parcour: ApcParcours) -> flask_sqlalchemy.BaseQuery:
|
||||
"""Les UEs d'un parcours de la formation.
|
||||
Si parcour est None, les UE sans parcours.
|
||||
Exemple: pour avoir les UE du semestre 3, faire
|
||||
`formation.query_ues_parcour(parcour).filter_by(semestre_idx=3)`
|
||||
"""
|
||||
return UniteEns.query.filter_by(formation=self).filter(
|
||||
UniteEns.type == UE_STANDARD,
|
||||
if parcour is None:
|
||||
return UniteEns.query.filter_by(
|
||||
formation=self, type=UE_STANDARD, parcour_id=None
|
||||
)
|
||||
return UniteEns.query.filter_by(formation=self, type=UE_STANDARD).filter(
|
||||
UniteEns.niveau_competence_id == ApcNiveau.id,
|
||||
(UniteEns.parcour_id == parcour.id) | (UniteEns.parcour_id == None),
|
||||
ApcParcoursNiveauCompetence.competence_id == ApcNiveau.competence_id,
|
||||
|
@ -215,14 +215,15 @@ def formsemestre_bulletinetud_published_dict(
|
||||
d["ue"] = []
|
||||
d["ue_capitalisee"] = []
|
||||
for ue_st in ues_stat:
|
||||
ue_status = nt.get_etud_ue_status(etudid, ue_st["ue_id"])
|
||||
ue_id = ue_st["ue_id"]
|
||||
ue_status = nt.get_etud_ue_status(etudid, ue_id)
|
||||
if ue_st["ects"] is None:
|
||||
ects_txt = ""
|
||||
else:
|
||||
ects_txt = f"{ue_st['ects']:2.3g}"
|
||||
rang, effectif = nt.get_etud_ue_rang(ue_st["ue_id"], etudid)
|
||||
rang, effectif = nt.get_etud_ue_rang(ue_id, etudid)
|
||||
u = dict(
|
||||
id=ue_st["ue_id"],
|
||||
id=ue_id,
|
||||
numero=quote_xml_attr(ue_st["numero"]),
|
||||
acronyme=quote_xml_attr(ue_st["acronyme"]),
|
||||
titre=quote_xml_attr(ue_st["titre"]),
|
||||
@ -243,7 +244,7 @@ def formsemestre_bulletinetud_published_dict(
|
||||
u["module"] = []
|
||||
# Structure UE/Matière/Module
|
||||
# Recodé en 2022
|
||||
ue = UniteEns.query.get(ue_st["ue_id"])
|
||||
ue = UniteEns.query.get(ue_id)
|
||||
u["matiere"] = [
|
||||
{
|
||||
"matiere_id": mat.id,
|
||||
@ -269,7 +270,7 @@ def formsemestre_bulletinetud_published_dict(
|
||||
u["module"] = _list_modimpls(
|
||||
nt,
|
||||
etudid,
|
||||
[mod for mod in modimpls if mod["module"]["ue_id"] == ue_st["ue_id"]],
|
||||
[mod for mod in modimpls if mod["module"]["ue_id"] == ue_id],
|
||||
prefs,
|
||||
version,
|
||||
)
|
||||
@ -282,7 +283,7 @@ def formsemestre_bulletinetud_published_dict(
|
||||
ects_txt = ""
|
||||
d["ue_capitalisee"].append(
|
||||
dict(
|
||||
id=ue.id,
|
||||
id=ue_id,
|
||||
numero=quote_xml_attr(ue.numero),
|
||||
acronyme=quote_xml_attr(ue.acronyme),
|
||||
titre=quote_xml_attr(ue.titre),
|
||||
|
@ -36,6 +36,7 @@ import flask
|
||||
from flask import g, url_for, request
|
||||
from flask_login import current_user
|
||||
|
||||
from app.auth.models import User
|
||||
from app.comp import res_sem
|
||||
from app.comp.res_compat import NotesTableCompat
|
||||
from app.models import Evaluation, FormSemestre
|
||||
@ -492,7 +493,7 @@ def evaluation_suppress_alln(evaluation_id, dialog_confirmed=False):
|
||||
|
||||
|
||||
def notes_add(
|
||||
user,
|
||||
user: User,
|
||||
evaluation_id: int,
|
||||
notes: list,
|
||||
comment=None,
|
||||
|
@ -1,7 +1,7 @@
|
||||
# -*- mode: python -*-
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
SCOVERSION = "9.4.8"
|
||||
SCOVERSION = "9.4.9"
|
||||
|
||||
SCONAME = "ScoDoc"
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user