From c79eb6410a36c9f7e8822c0f914a06042fe72869 Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Mon, 24 Jul 2023 21:38:04 +0200 Subject: [PATCH 1/5] Correction affectation parcours (report sco96) --- app/templates/scolar/partition_editor.j2 | 2 +- app/templates/scolar/students_groups_auto_assignment.j2 | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/templates/scolar/partition_editor.j2 b/app/templates/scolar/partition_editor.j2 index 79ca2f6200..b9a95eb1f7 100644 --- a/app/templates/scolar/partition_editor.j2 +++ b/app/templates/scolar/partition_editor.j2 @@ -23,7 +23,7 @@

Étudiants

- Outils d'affections + Outils d'affectation
Date: Thu, 10 Aug 2023 19:08:01 +0200 Subject: [PATCH 2/5] =?UTF-8?q?Fix:=20calcul=20de=20la=20liste=20des=20niv?= =?UTF-8?q?eaux=20associ=C3=A9s=20=C3=A0=20une=20ann=C3=A9e=20de=20parcour?= =?UTF-8?q?s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/but_refcomp.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/app/models/but_refcomp.py b/app/models/but_refcomp.py index 2cb1145d72..73ddf9f7ad 100644 --- a/app/models/but_refcomp.py +++ b/app/models/but_refcomp.py @@ -471,9 +471,16 @@ class ApcNiveau(db.Model, XMLModel): for pn in parcour_niveaux ] else: - niveaux: list[ApcNiveau] = competence.niveaux.filter_by( - annee=f"BUT{int(annee)}" - ).all() + niveaux: list[ApcNiveau] = ( + ApcNiveau.query.filter_by(annee=f"BUT{int(annee)}") + .join(ApcCompetence) + .filter_by(id=competence.id) + .join(ApcParcoursNiveauCompetence) + .filter(ApcParcoursNiveauCompetence.niveau == ApcNiveau.ordre) + .join(ApcAnneeParcours) + .filter_by(parcours_id=parcour.id) + .all() + ) _cache[key] = niveaux return niveaux From 1dfe75479378e8f1857c794208ded0d1ad6c8ee5 Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Thu, 10 Aug 2023 19:51:42 +0200 Subject: [PATCH 3/5] Fix CLI flask delete-dept -f --- scodoc.py | 1 + 1 file changed, 1 insertion(+) diff --git a/scodoc.py b/scodoc.py index f541cce661..44e65aa60c 100755 --- a/scodoc.py +++ b/scodoc.py @@ -412,6 +412,7 @@ def delete_dept(dept, force=False): # delete-dept from app.scodoc import notesdb as ndb from app.scodoc import sco_dept + msg = "" db.reflect() ndb.open_db_connection() d = models.Departement.query.filter_by(acronym=dept).first() From 96531f839c066dee68b773eb7a70b4dafe99f527 Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Thu, 10 Aug 2023 21:15:42 +0200 Subject: [PATCH 4/5] Fix: tests unitaires test_but_jury.py. + check in package building script. --- tests/unit/test_abs_counts.py | 4 ---- tests/unit/yaml_setup_but.py | 5 +++-- tools/build_release.sh | 4 ++-- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/tests/unit/test_abs_counts.py b/tests/unit/test_abs_counts.py index 5b0a5f0425..9f1147bb35 100644 --- a/tests/unit/test_abs_counts.py +++ b/tests/unit/test_abs_counts.py @@ -6,14 +6,10 @@ Comptage des absences """ # test écrit par Fares Amer, mai 2021 et porté sur ScoDoc 8 en juillet 2021 -import json - from tests.unit import sco_fake_gen from app.scodoc import sco_abs, sco_formsemestre from app.scodoc import sco_abs_views -from app.scodoc import sco_groups -from app.views import absences def test_abs_counts(test_client): diff --git a/tests/unit/yaml_setup_but.py b/tests/unit/yaml_setup_but.py index 8412ed2be3..d87ca13504 100644 --- a/tests/unit/yaml_setup_but.py +++ b/tests/unit/yaml_setup_but.py @@ -134,8 +134,9 @@ def associe_modules_et_parcours(formation: Formation, formation_infos: dict): for module in formation.modules if re.match(code_module, module.code) ]: - module.parcours.append(parcour) - db.session.add(module) + if not parcour in module.parcours: + module.parcours.append(parcour) + db.session.add(module) db.session.commit() diff --git a/tools/build_release.sh b/tools/build_release.sh index 99ab4c8914..f7f89828a1 100755 --- a/tools/build_release.sh +++ b/tools/build_release.sh @@ -59,10 +59,10 @@ SCODOC_USER=scodoc # Tests unitaires lancés dans le répertoire de travail echo "TESTS UNITAIRES" -(cd "$UNIT_TESTS_DIR"; pytest tests/unit) +(cd "$UNIT_TESTS_DIR"; pytest tests/unit) || terminate "Erreur dans tests unitaires" # Tests API -(cd "$UNIT_TESTS_DIR"; tools/test_api.sh) +(cd "$UNIT_TESTS_DIR"; tools/test_api.sh) || terminate "Erreur dans tests unitaires API" # Création répertoire du paquet, et de opt From 632e285d26259ec6b549ec060c1c3697437c75b7 Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Fri, 11 Aug 2023 09:23:44 +0200 Subject: [PATCH 5/5] =?UTF-8?q?9.5.8=20avec=20qq=20fix=20backport=C3=A9s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sco_version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sco_version.py b/sco_version.py index 48d153a134..69fb1801c0 100644 --- a/sco_version.py +++ b/sco_version.py @@ -1,7 +1,7 @@ # -*- mode: python -*- # -*- coding: utf-8 -*- -SCOVERSION = "9.5.7" +SCOVERSION = "9.5.8" SCONAME = "ScoDoc"