diff --git a/app/but/bulletin_but.py b/app/but/bulletin_but.py index 5ec30c5e3..918d14fd2 100644 --- a/app/but/bulletin_but.py +++ b/app/but/bulletin_but.py @@ -349,19 +349,12 @@ class BulletinBUT: raise ScoValueError("bulletin_etud: version de bulletin demandée invalide") res = self.res formsemestre = res.formsemestre - etat_inscription = etud.inscription_etat(formsemestre.id) - nb_inscrits = self.res.get_inscriptions_counts()[scu.INSCRIT] - published = (not formsemestre.bul_hide_xml) or force_publishing - if formsemestre.formation.referentiel_competence is None: - etud_ues_ids = {ue.id for ue in res.ues if res.modimpls_in_ue(ue, etud.id)} - else: - etud_ues_ids = res.etud_ues_ids(etud.id) - d = { "version": "0", "type": "BUT", "date": datetime.datetime.utcnow().isoformat() + "Z", "publie": not formsemestre.bul_hide_xml, + "etat_inscription": etud.inscription_etat(formsemestre.id), "etudiant": etud.to_dict_bul(), "formation": { "id": formsemestre.formation.id, @@ -370,14 +363,20 @@ class BulletinBUT: "titre": formsemestre.formation.titre, }, "formsemestre_id": formsemestre.id, - "etat_inscription": etat_inscription, "options": sco_preferences.bulletin_option_affichage( formsemestre, self.prefs ), } - if not published: + published = (not formsemestre.bul_hide_xml) or force_publishing + if not published or d["etat_inscription"] is False: return d + nb_inscrits = self.res.get_inscriptions_counts()[scu.INSCRIT] + if formsemestre.formation.referentiel_competence is None: + etud_ues_ids = {ue.id for ue in res.ues if res.modimpls_in_ue(ue, etud.id)} + else: + etud_ues_ids = res.etud_ues_ids(etud.id) + nbabs, nbabsjust = formsemestre.get_abs_count(etud.id) etud_groups = sco_groups.get_etud_formsemestre_groups( etud, formsemestre, only_to_show=True @@ -410,7 +409,7 @@ class BulletinBUT: semestre_infos.update( sco_bulletins_json.dict_decision_jury(etud, formsemestre) ) - if etat_inscription == scu.INSCRIT: + if d["etat_inscription"] == scu.INSCRIT: # moyenne des moyennes générales du semestre semestre_infos["notes"] = { "value": fmt_note(res.etud_moy_gen[etud.id]), diff --git a/sco_version.py b/sco_version.py index 35a788bfb..65feb9eb6 100644 --- a/sco_version.py +++ b/sco_version.py @@ -1,7 +1,7 @@ # -*- mode: python -*- # -*- coding: utf-8 -*- -SCOVERSION = "9.6.88" +SCOVERSION = "9.6.89" SCONAME = "ScoDoc"