From 71615613f15a6626d5d846b72beef0d32d48fa9a Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Fri, 17 Dec 2021 21:36:34 +0100 Subject: [PATCH] =?UTF-8?q?Fix:=20bulletins=20oldjson=20des=20d=C3=A9m.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/scodoc/sco_bulletins_json.py | 7 +++++++ app/scodoc/sco_groups.py | 2 +- app/views/notes.py | 2 ++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/app/scodoc/sco_bulletins_json.py b/app/scodoc/sco_bulletins_json.py index 2b5ec2c4e..81df14d6a 100644 --- a/app/scodoc/sco_bulletins_json.py +++ b/app/scodoc/sco_bulletins_json.py @@ -33,6 +33,7 @@ import json from app.but import bulletin_but from app.models.formsemestre import FormSemestre +from app.models.etudiants import Identite import app.scodoc.sco_utils as scu import app.scodoc.notesdb as ndb @@ -86,6 +87,7 @@ def formsemestre_bulletinetud_published_dict( from app.scodoc import sco_bulletins formsemestre = FormSemestre.query.get_or_404(formsemestre_id) + etud = Identite.query.get(etudid) sem = sco_formsemestre.get_formsemestre(formsemestre_id) if formsemestre.formation.is_apc(): @@ -139,6 +141,11 @@ def formsemestre_bulletinetud_published_dict( if not published: return d # stop ! + etat_inscription = etud.etat_inscription(formsemestre.id) + if etat_inscription != scu.INSCRIT: + d.update(dict_decision_jury(etudid, formsemestre_id, with_decisions=True)) + return d + # Groupes: partitions = sco_groups.get_partitions_list(formsemestre_id, with_default=False) partitions_etud_groups = {} # { partition_id : { etudid : group } } diff --git a/app/scodoc/sco_groups.py b/app/scodoc/sco_groups.py index cfd331968..da46270d6 100644 --- a/app/scodoc/sco_groups.py +++ b/app/scodoc/sco_groups.py @@ -35,7 +35,6 @@ Optimisation possible: """ import collections import operator -import re import time from xml.etree import ElementTree @@ -45,6 +44,7 @@ import flask from flask import g, request from flask import url_for, make_response +from app import db from app.models.groups import Partition import app.scodoc.sco_utils as scu import app.scodoc.notesdb as ndb diff --git a/app/views/notes.py b/app/views/notes.py index 8ec4702bb..a7ed9fd55 100644 --- a/app/views/notes.py +++ b/app/views/notes.py @@ -285,6 +285,8 @@ def formsemestre_bulletinetud( prefer_mail_perso=False, code_nip=None, ): + if not formsemestre_id: + flask.abort(404, "argument manquant: formsemestre_id") formsemestre = FormSemestre.query.get_or_404(formsemestre_id) if formsemestre.formation.is_apc() and format != "oldjson": if etudid: