From a47faa0115e74579109ab09e9f971f827fbfe764 Mon Sep 17 00:00:00 2001 From: Yann Leboulanger Date: Wed, 26 Jan 2022 14:27:55 +0100 Subject: [PATCH 1/4] Fix PE generation --- app/pe/pe_tools.py | 2 +- app/pe/pe_view.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/pe/pe_tools.py b/app/pe/pe_tools.py index a495f96509..2c9dd23017 100644 --- a/app/pe/pe_tools.py +++ b/app/pe/pe_tools.py @@ -206,7 +206,7 @@ def add_pe_stuff_to_zip(zipfile, ziproot): for name in logos_names: logo = find_logo(logoname=name, dept_id=g.scodoc_dept_id) if logo is not None: - add_local_file_to_zip(zipfile, ziproot, logo, "avis/logos/" + logo.filename) + add_local_file_to_zip(zipfile, ziproot, logo.filepath, "avis/logos/" + logo.filename) # ---------------------------------------------------------------------------------------- diff --git a/app/pe/pe_view.py b/app/pe/pe_view.py index 43a00ebe56..5a98d375fb 100644 --- a/app/pe/pe_view.py +++ b/app/pe/pe_view.py @@ -97,7 +97,7 @@ def pe_view_sem_recap( template_latex = "" # template fourni via le formulaire Web if avis_tmpl_file: - template_latex = avis_tmpl_file.read() + template_latex = avis_tmpl_file.read().decode('utf-8') template_latex = template_latex else: # template indiqué dans préférences ScoDoc ? @@ -114,7 +114,7 @@ def pe_view_sem_recap( footer_latex = "" # template fourni via le formulaire Web if footer_tmpl_file: - footer_latex = footer_tmpl_file.read() + footer_latex = footer_tmpl_file.read().decode('utf-8') footer_latex = footer_latex else: footer_latex = pe_avislatex.get_code_latex_from_scodoc_preference( From a95338743739deb8fcc0dfd8264946650d05e3ec Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Wed, 26 Jan 2022 23:51:46 +0100 Subject: [PATCH 2/4] =?UTF-8?q?r=C3=A9active=20avis=20PE=20pour=20essais?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/scodoc/sco_formsemestre_status.py | 4 ++-- sco_version.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/scodoc/sco_formsemestre_status.py b/app/scodoc/sco_formsemestre_status.py index 5c31898986..cf72ed1880 100644 --- a/app/scodoc/sco_formsemestre_status.py +++ b/app/scodoc/sco_formsemestre_status.py @@ -105,10 +105,10 @@ def _build_menu_stats(formsemestre_id): "enabled": True, }, { - "title": "Documents Avis Poursuite Etudes", + "title": "Documents Avis Poursuite Etudes (xp)", "endpoint": "notes.pe_view_sem_recap", "args": {"formsemestre_id": formsemestre_id}, - "enabled": current_app.config["TESTING"] or current_app.config["DEBUG"], + "enabled": True, # current_app.config["TESTING"] or current_app.config["DEBUG"], }, { "title": 'Table "débouchés"', diff --git a/sco_version.py b/sco_version.py index 9540dbe556..8ef59e41f1 100644 --- a/sco_version.py +++ b/sco_version.py @@ -1,7 +1,7 @@ # -*- mode: python -*- # -*- coding: utf-8 -*- -SCOVERSION = "9.1.33" +SCOVERSION = "9.1.34" SCONAME = "ScoDoc" From 715d7aa9ee89ef02297167a79fc53c247ec4cca5 Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Thu, 27 Jan 2022 00:18:50 +0100 Subject: [PATCH 3/4] 9.1.35 --- app/scodoc/sco_edit_ue.py | 12 ++++++++++-- sco_version.py | 2 +- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/app/scodoc/sco_edit_ue.py b/app/scodoc/sco_edit_ue.py index c9a2da171a..1de9969ef4 100644 --- a/app/scodoc/sco_edit_ue.py +++ b/app/scodoc/sco_edit_ue.py @@ -33,13 +33,15 @@ from flask import url_for, render_template from flask import g, request from flask_login import current_user +from app import db +from app import log from app.models import APO_CODE_STR_LEN from app.models import Formation, UniteEns, ModuleImpl, Module +from app.models.formations import Matiere import app.scodoc.notesdb as ndb import app.scodoc.sco_utils as scu from app.scodoc.sco_utils import ModuleType -from app import log -from app.scodoc.TrivialFormulator import TrivialFormulator, TF +from app.scodoc.TrivialFormulator import TrivialFormulator from app.scodoc.gen_tables import GenTable from app.scodoc.sco_permissions import Permission from app.scodoc.sco_exceptions import ( @@ -533,6 +535,12 @@ def ue_table(formation_id=None, semestre_idx=1, msg=""): # was ue_list # pour faciliter la transition des anciens programmes non APC for ue in ues_obj: ue.guess_semestre_idx() + # vérifie qu'on a bien au moins une matière dans chaque UE + for ue in ues_obj: + if ue.matieres.count() < 1: + mat = Matiere(ue_id=ue.id) + db.session.add(mat) + db.session.commit() ues = [ue.to_dict() for ue in ues_obj] ues_externes = [ue.to_dict() for ue in ues_externes_obj] diff --git a/sco_version.py b/sco_version.py index 8ef59e41f1..00415b082a 100644 --- a/sco_version.py +++ b/sco_version.py @@ -1,7 +1,7 @@ # -*- mode: python -*- # -*- coding: utf-8 -*- -SCOVERSION = "9.1.34" +SCOVERSION = "9.1.35" SCONAME = "ScoDoc" From 70a00cd1b54b21421ae0d1f7988d9916cc5a2596 Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Thu, 27 Jan 2022 10:22:42 +0100 Subject: [PATCH 4/4] Lien sur message erreur saisie incorrecte eval --- app/scodoc/sco_evaluation_db.py | 3 ++- app/scodoc/sco_exceptions.py | 2 +- sco_version.py | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/scodoc/sco_evaluation_db.py b/app/scodoc/sco_evaluation_db.py index 17d47915ae..6586ddd099 100644 --- a/app/scodoc/sco_evaluation_db.py +++ b/app/scodoc/sco_evaluation_db.py @@ -185,7 +185,8 @@ def _check_evaluation_args(args): if (jour > date_fin) or (jour < date_debut): raise ScoValueError( "La date de l'évaluation (%s/%s/%s) n'est pas dans le semestre !" - % (d, m, y) + % (d, m, y), + dest_url="javascript:history.back();", ) heure_debut = args.get("heure_debut", None) args["heure_debut"] = heure_debut diff --git a/app/scodoc/sco_exceptions.py b/app/scodoc/sco_exceptions.py index 5f64f57b23..112658e658 100644 --- a/app/scodoc/sco_exceptions.py +++ b/app/scodoc/sco_exceptions.py @@ -40,7 +40,7 @@ class InvalidNoteValue(ScoException): pass -# Exception qui stoque dest_url, utilisee dans Zope standard_error_message +# Exception qui stoque dest_url class ScoValueError(ScoException): def __init__(self, msg, dest_url=None): super().__init__(msg) diff --git a/sco_version.py b/sco_version.py index 00415b082a..c3e7252051 100644 --- a/sco_version.py +++ b/sco_version.py @@ -1,7 +1,7 @@ # -*- mode: python -*- # -*- coding: utf-8 -*- -SCOVERSION = "9.1.35" +SCOVERSION = "9.1.36" SCONAME = "ScoDoc"