From 8add5a66cd1ad9e7355debaa3504f34ff3b8e3c5 Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Wed, 4 Sep 2024 21:10:16 +0200 Subject: [PATCH] Fix: form_import_infos_admissions missing argument in view --- .../formsemestre/form_import_infos_admissions.j2 | 2 +- app/views/scolar.py | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/app/templates/formsemestre/form_import_infos_admissions.j2 b/app/templates/formsemestre/form_import_infos_admissions.j2 index 90a665888..c4fc5b3a2 100644 --- a/app/templates/formsemestre/form_import_infos_admissions.j2 +++ b/app/templates/formsemestre/form_import_infos_admissions.j2 @@ -50,7 +50,7 @@
exporter les données actuelles de ScoDoc
(ce fichier peut être ré-importé après d'éventuelles modifications) diff --git a/app/views/scolar.py b/app/views/scolar.py index 688be4524..68bab7b4c 100644 --- a/app/views/scolar.py +++ b/app/views/scolar.py @@ -2259,18 +2259,18 @@ def import_generate_excel_sample(with_codesemestre="1"): @scodoc7func def import_generate_admission_sample(formsemestre_id): "une feuille excel pour importation données admissions" - group = sco_groups.get_group(sco_groups.get_default_group(formsemestre_id)) + formsemestre = FormSemestre.get_formsemestre(formsemestre_id) + group = formsemestre.get_default_group() fmt = sco_import_etuds.sco_import_format() data = sco_import_etuds.sco_import_generate_excel_sample( fmt, only_tables=["identite", "admissions", "adresse"], exclude_cols=["nationalite", "foto", "photo_filename"], - group_ids=[group["group_id"]], + group_ids=[group.id], ) return scu.send_file( data, "AdmissionEtudiants", scu.XLSX_SUFFIX, mime=scu.XLSX_MIMETYPE ) - # return sco_excel.send_excel_file(data, "AdmissionEtudiants" + scu.XLSX_SUFFIX) # --- Données admission depuis fichier excel (version nov 2016) @@ -2280,6 +2280,7 @@ def import_generate_admission_sample(formsemestre_id): @scodoc7func def form_import_infos_admissions(formsemestre_id=None): "formulaire import xls" + formsemestre = FormSemestre.get_formsemestre(formsemestre_id) authuser = current_user if not authuser.has_permission(Permission.EtudInscrit): # autorise juste l'export @@ -2291,7 +2292,7 @@ def form_import_infos_admissions(formsemestre_id=None): les étudiants (admission, ...)

Exporter les informations de ScoDoc (classeur Excel) (ce fichier peut être ré-importé après d'éventuelles modifications)

@@ -2337,6 +2338,8 @@ def form_import_infos_admissions(formsemestre_id=None): title="Import données admissions", tf_form=tf[1], adm_table_description_format=sco_import_etuds.adm_table_description_format().html(), + formsemestre=formsemestre, + sco=ScoData(formsemestre=formsemestre), ) if tf[0] == -1: return flask.redirect(