From 72895f938efd102bd75b89e464d8f7a5e2fb6580 Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Thu, 25 Aug 2022 12:04:10 +0200 Subject: [PATCH] API: Section "malus" dans formsemestre_programme --- app/api/formsemestres.py | 1 + app/models/modules.py | 10 ++++++---- app/scodoc/sco_utils.py | 4 ++-- sco_version.py | 2 +- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/app/api/formsemestres.py b/app/api/formsemestres.py index d7397277f0..257cda6e2a 100644 --- a/app/api/formsemestres.py +++ b/app/api/formsemestres.py @@ -245,6 +245,7 @@ def formsemestre_programme(formsemestre_id: int): "ressources": m_list[ModuleType.RESSOURCE], "saes": m_list[ModuleType.SAE], "modules": m_list[ModuleType.STANDARD], + "malus": m_list[ModuleType.MALUS], } ) diff --git a/app/models/modules.py b/app/models/modules.py index 6cf23f9cf9..d90019ba74 100644 --- a/app/models/modules.py +++ b/app/models/modules.py @@ -105,12 +105,14 @@ class Module(db.Model): scu.ModuleType.SAE, } - def type_name(self): + def type_name(self) -> str: + "Le nom du type de module, pour les humains (avec majuscules et accents)" return scu.MODULE_TYPE_NAMES[self.module_type] - def type_abbrv(self): - """ "mod", "malus", "res", "sae" - (utilisées pour style css)""" + def type_abbrv(self) -> str: + """Le nom du type de module, pour les styles CSS. + "mod", "malus", "res", "sae" + """ return scu.ModuleType.get_abbrev(self.module_type) def set_ue_coef(self, ue, coef: float) -> None: diff --git a/app/scodoc/sco_utils.py b/app/scodoc/sco_utils.py index 1d265f6a0a..9e72237491 100644 --- a/app/scodoc/sco_utils.py +++ b/app/scodoc/sco_utils.py @@ -94,9 +94,9 @@ class ModuleType(IntEnum): @classmethod def get_abbrev(cls, code) -> str: - """Chaine abregée décrivant le type de module à partir du code integer: + """Abbréviation décrivant le type de module à partir du code integer: "mod", "malus", "res", "sae" - (utilisées pour style css) + (utilisées pour style CSS) """ return { ModuleType.STANDARD: "mod", diff --git a/sco_version.py b/sco_version.py index f840d9deed..43de22c015 100644 --- a/sco_version.py +++ b/sco_version.py @@ -1,7 +1,7 @@ # -*- mode: python -*- # -*- coding: utf-8 -*- -SCOVERSION = "9.3.26" +SCOVERSION = "9.3.27" SCONAME = "ScoDoc"