From 766ea31be51221d161821fa99029e32272e8250b Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Mon, 14 Mar 2022 10:56:25 +0100 Subject: [PATCH] small fixes --- app/scodoc/sco_bulletins_standard.py | 8 ++++---- app/scodoc/sco_edit_apc.py | 3 +-- app/views/__init__.py | 7 ++++++- sco_version.py | 2 +- 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/app/scodoc/sco_bulletins_standard.py b/app/scodoc/sco_bulletins_standard.py index 842844d68..f1b2b7cc7 100644 --- a/app/scodoc/sco_bulletins_standard.py +++ b/app/scodoc/sco_bulletins_standard.py @@ -380,10 +380,10 @@ class BulletinGeneratorStandard(sco_bulletins_generator.BulletinGenerator): t = { "titre": "Moyenne générale:", "rang": I["rang_nt"], - "note": I["moy_gen"], - "min": I["moy_min"], - "max": I["moy_max"], - "moy": I["moy_moy"], + "note": I.get("moy_gen", "-"), + "min": I.get("moy_min", "-"), + "max": I.get("moy_max", "-"), + "moy": I.get("moy_moy", "-"), "abs": "%s / %s" % (nbabs, nbabsjust), "_css_row_class": "notes_bulletin_row_gen", "_titre_colspan": 2, diff --git a/app/scodoc/sco_edit_apc.py b/app/scodoc/sco_edit_apc.py index cec8b7c2a..c53094ef5 100644 --- a/app/scodoc/sco_edit_apc.py +++ b/app/scodoc/sco_edit_apc.py @@ -166,7 +166,7 @@ def html_edit_formation_apc( def html_ue_infos(ue): - """page d'information sur une UE""" + """Page d'information sur une UE""" from app.views import ScoData formsemestres = ( @@ -189,7 +189,6 @@ def html_ue_infos(ue): ) return render_template( "pn/ue_infos.html", - # "pn/tmp.html", titre=f"UE {ue.acronyme} {ue.titre}", ue=ue, formsemestres=formsemestres, diff --git a/app/views/__init__.py b/app/views/__init__.py index f3c8e13d4..4696872a1 100644 --- a/app/views/__init__.py +++ b/app/views/__init__.py @@ -97,7 +97,12 @@ class ScoData: self.sem.to_dict() ) # --- Préférences - self.prefs = sco_preferences.SemPreferences(formsemestre.id) + # prefs fallback to global pref if sem is None: + if formsemestre: + formsemestre_id = formsemestre.id + else: + formsemestre_id = None + self.prefs = sco_preferences.SemPreferences(formsemestre_id) from app.views import scodoc, notes, scolar, absences, users, pn_modules, refcomp diff --git a/sco_version.py b/sco_version.py index 7657bac43..e62e3eb87 100644 --- a/sco_version.py +++ b/sco_version.py @@ -1,7 +1,7 @@ # -*- mode: python -*- # -*- coding: utf-8 -*- -SCOVERSION = "9.1.78" +SCOVERSION = "9.1.79" SCONAME = "ScoDoc"