From fd80ee2452031dd754d1b58e24f6433a4d2a5461 Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Sun, 5 Dec 2021 21:54:04 +0100 Subject: [PATCH] bul json: options affichage --- app/but/bulletin_but.py | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/app/but/bulletin_but.py b/app/but/bulletin_but.py index 32b7ee7c4f..9d6e4855a4 100644 --- a/app/but/bulletin_but.py +++ b/app/but/bulletin_but.py @@ -14,6 +14,7 @@ from app.comp import df_cache, moy_ue, moy_mod, inscr_mod from app.scodoc import sco_utils as scu from app.scodoc.sco_cache import ResultatsSemestreBUTCache from app.scodoc.sco_exceptions import ScoFormatError +from app.scodoc import sco_preferences from app.scodoc.sco_utils import jsnan @@ -220,5 +221,35 @@ class ResultatsSemestreBUT: "date_jury": "AAAA-MM-JJ", # XXX TODO "groupes": [], # XXX TODO }, + "options": bulletin_option_affichage(formsemestre), } return d + + +def bulletin_option_affichage(formsemestre): + "dict avec les options d'affichages (préférences) pour ce semestre" + prefs = sco_preferences.SemPreferences(formsemestre.id) + fields = ( + "bul_show_abs", + "bul_show_abs_modules", + "bul_show_ects", + "bul_show_codemodules", + "bul_show_matieres", + "bul_show_all_evals", + "bul_show_rangs", + "bul_show_ue_rangs", + "bul_show_mod_rangs", + "bul_show_moypromo", + "bul_show_minmax", + "bul_show_minmax_mod", + "bul_show_minmax_eval", + "bul_show_coef", + "bul_show_ue_cap_details", + "bul_show_ue_cap_current", + "bul_show_temporary", + "bul_temporary_txt", + "bul_show_uevalid", + "bul_show_date_inscr", + ) + # on enlève le "bul_" de la clé: + return {field[4:]: prefs[field] for field in fields}