1
0
forked from ScoDoc/ScoDoc
This commit is contained in:
Jean-Marie Place 2021-09-18 10:51:19 +02:00
parent 80f5536de5
commit c955870e1e
3 changed files with 13 additions and 4 deletions

View File

@ -794,7 +794,10 @@ def groups_table(
title = "etudiants_%s" % groups_infos.groups_filename title = "etudiants_%s" % groups_infos.groups_filename
xls = sco_excel.excel_simple_table(titles=titles, lines=L, sheet_name=title) xls = sco_excel.excel_simple_table(titles=titles, lines=L, sheet_name=title)
filename = title + scu.XLSX_SUFFIX 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: else:
raise ValueError("unsupported format") raise ValueError("unsupported format")

View File

@ -1937,7 +1937,9 @@ def import_generate_excel_sample(REQUEST, with_codesemestre="1"):
data = sco_import_etuds.sco_import_generate_excel_sample( data = sco_import_etuds.sco_import_generate_excel_sample(
format, with_codesemestre, exclude_cols=["photo_filename"] 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) # 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"], exclude_cols=["nationalite", "foto", "photo_filename"],
group_ids=[group["group_id"]], 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) # return sco_excel.send_excel_file(REQUEST, data, "AdmissionEtudiants" + scu.XLSX_SUFFIX)

View File

@ -488,7 +488,9 @@ def create_user_form(REQUEST, user_name=None, edit=0, all_roles=1):
def import_users_generate_excel_sample(REQUEST): def import_users_generate_excel_sample(REQUEST):
"une feuille excel pour importation utilisateurs" "une feuille excel pour importation utilisateurs"
data = sco_import_users.generate_excel_sample() 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) # return sco_excel.send_excel_file(REQUEST, data, "ImportUtilisateurs" + scu.XLSX_SUFFIX)