From 94db71280fa16db664417880c8bb1698a0b6289b Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Sat, 19 Aug 2023 16:17:21 +0200 Subject: [PATCH] Revert "Assiduites : metrique interne externe" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Changement non compatible avec les préférences en production. This reverts commit afe2caac2d98daeaeecc4573e5d0f09728b38c05. --- app/but/bulletin_but.py | 8 +++++--- app/models/formsemestre.py | 9 +++++++-- app/scodoc/html_sidebar.py | 2 +- app/scodoc/sco_abs_notification.py | 6 +++++- app/scodoc/sco_assiduites.py | 4 ++-- app/scodoc/sco_preferences.py | 20 +++++++------------- app/scodoc/sco_utils.py | 11 +++++++++++ app/tables/visu_assiduites.py | 4 ++-- app/views/__init__.py | 4 +++- app/views/assiduites.py | 8 ++++---- 10 files changed, 47 insertions(+), 29 deletions(-) diff --git a/app/but/bulletin_but.py b/app/but/bulletin_but.py index f2a3b744b..3231cc88e 100644 --- a/app/but/bulletin_but.py +++ b/app/but/bulletin_but.py @@ -387,9 +387,11 @@ class BulletinBUT: semestre_infos["absences"] = { "injustifie": nbabs - nbabsjust, "total": nbabs, - "metrique": sco_preferences.ASSIDUITES_METRIC_LABEL_LONG.get( - sco_preferences.get_preference("assi_metrique") - ), + "metrique": { + "H.": "Heure(s)", + "J.": "Journée(s)", + "1/2 J.": "1/2 Jour.", + }.get(sco_preferences.get_preference("assi_metrique")), } decisions_ues = self.res.get_etud_decisions_ue(etud.id) or {} if self.prefs["bul_show_ects"]: diff --git a/app/models/formsemestre.py b/app/models/formsemestre.py index af856f75e..e4690a06a 100644 --- a/app/models/formsemestre.py +++ b/app/models/formsemestre.py @@ -39,9 +39,11 @@ from app.models.validations import ScolarFormSemestreValidation from app.scodoc import codes_cursus, sco_preferences from app.scodoc.sco_exceptions import ScoValueError from app.scodoc.sco_permissions import Permission -from app.scodoc.sco_utils import MONTH_NAMES_ABBREV +from app.scodoc.sco_utils import MONTH_NAMES_ABBREV, translate_assiduites_metric from app.scodoc.sco_vdi import ApoEtapeVDI +from app.scodoc.sco_utils import translate_assiduites_metric + GROUPS_AUTO_ASSIGNMENT_DATA_MAX = 1024 * 1024 # bytes @@ -716,7 +718,10 @@ class FormSemestre(db.Model): metrique = sco_preferences.get_preference("assi_metrique", self.id) return sco_assiduites.get_assiduites_count_in_interval( - etudid, self.date_debut.isoformat(), self.date_fin.isoformat(), metrique + etudid, + self.date_debut.isoformat(), + self.date_fin.isoformat(), + translate_assiduites_metric(metrique), ) def get_codes_apogee(self, category=None) -> set[str]: diff --git a/app/scodoc/html_sidebar.py b/app/scodoc/html_sidebar.py index 72310acd6..820bf8987 100755 --- a/app/scodoc/html_sidebar.py +++ b/app/scodoc/html_sidebar.py @@ -122,7 +122,7 @@ def sidebar(etudid: int = None): nbabs, nbabsjust = sco_assiduites.get_assiduites_count(etudid, cur_sem) nbabsnj = nbabs - nbabsjust H.append( - f"""({sco_preferences.ASSIDUITES_METRIC_LABEL_SHORT.get(sco_preferences.get_preference("assi_metrique", "demi"))}) + f"""({sco_preferences.get_preference("assi_metrique", None)})
{ nbabsjust } J., { nbabsnj } N.J.
""" ) H.append("