From c955870e1ece7c2923e887178384eb48efed115e Mon Sep 17 00:00:00 2001 From: Place Jean-Marie Date: Sat, 18 Sep 2021 10:51:19 +0200 Subject: [PATCH] recheck --- app/scodoc/sco_groups_view.py | 5 ++++- app/views/scolar.py | 8 ++++++-- app/views/users.py | 4 +++- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/app/scodoc/sco_groups_view.py b/app/scodoc/sco_groups_view.py index f1962212c..82c137e2d 100644 --- a/app/scodoc/sco_groups_view.py +++ b/app/scodoc/sco_groups_view.py @@ -794,7 +794,10 @@ def groups_table( title = "etudiants_%s" % groups_infos.groups_filename xls = sco_excel.excel_simple_table(titles=titles, lines=L, sheet_name=title) filename = title + scu.XLSX_SUFFIX - return sco_excel.send_excel_file(REQUEST, xls, filename) + return scu.send_file( + xls, filename, scu.XLSX_SUFFIX, scu.XLSX_MIMETYPE, attached=True + ) + # return sco_excel.send_excel_file(REQUEST, xls, filename) else: raise ValueError("unsupported format") diff --git a/app/views/scolar.py b/app/views/scolar.py index e57e0a01b..24d03bc40 100644 --- a/app/views/scolar.py +++ b/app/views/scolar.py @@ -1937,7 +1937,9 @@ def import_generate_excel_sample(REQUEST, with_codesemestre="1"): data = sco_import_etuds.sco_import_generate_excel_sample( format, with_codesemestre, exclude_cols=["photo_filename"] ) - return scu.send_file(data, "ImportEtudiants", scu.XLSX_SUFFIX, scu.XLSX_MIMETYPE, attached=True) + return scu.send_file( + data, "ImportEtudiants", scu.XLSX_SUFFIX, scu.XLSX_MIMETYPE, attached=True + ) # return sco_excel.send_excel_file(REQUEST, data, "ImportEtudiants" + scu.XLSX_SUFFIX) @@ -1956,7 +1958,9 @@ def import_generate_admission_sample(REQUEST, formsemestre_id): exclude_cols=["nationalite", "foto", "photo_filename"], group_ids=[group["group_id"]], ) - return scu.send_file(data, "AdmissionEtudiants", scu.XLSX_SUFFIX, scu.XLSX_MIMETYPE, attached=True) + return scu.send_file( + data, "AdmissionEtudiants", scu.XLSX_SUFFIX, scu.XLSX_MIMETYPE, attached=True + ) # return sco_excel.send_excel_file(REQUEST, data, "AdmissionEtudiants" + scu.XLSX_SUFFIX) diff --git a/app/views/users.py b/app/views/users.py index c9f680d61..9726efd17 100644 --- a/app/views/users.py +++ b/app/views/users.py @@ -488,7 +488,9 @@ def create_user_form(REQUEST, user_name=None, edit=0, all_roles=1): def import_users_generate_excel_sample(REQUEST): "une feuille excel pour importation utilisateurs" data = sco_import_users.generate_excel_sample() - return scu.send_file(data, "ImportUtilisateurs", scu.XLSX_SUFFIX, scu.XLSX_MIMETYPE, attached=True) + return scu.send_file( + data, "ImportUtilisateurs", scu.XLSX_SUFFIX, scu.XLSX_MIMETYPE, attached=True + ) # return sco_excel.send_excel_file(REQUEST, data, "ImportUtilisateurs" + scu.XLSX_SUFFIX)