forked from ScoDoc/DocScoDoc
Merge pull request 'fix suffix processing' (#135) from jmplace/ScoDoc-Lille:fix_suffix into master
Reviewed-on: https://scodoc.org/git/viennet/ScoDoc/pulls/135
This commit is contained in:
commit
4e59b9597b
@ -272,7 +272,6 @@ def etudarchive_generate_excel_sample(group_id=None, REQUEST=None):
|
||||
suffix=scu.XLSX_SUFFIX,
|
||||
mime=scu.XLSX_MIMETYPE,
|
||||
)
|
||||
# return sco_excel.send_excel_file(REQUEST, data, "ImportFichiersEtudiants" + scu.XLSX_SUFFIX)
|
||||
|
||||
|
||||
def etudarchive_import_files_form(group_id, REQUEST=None):
|
||||
|
@ -786,7 +786,7 @@ def groups_table(
|
||||
L = [dicttakestr(m, keys) for m in groups_infos.members]
|
||||
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
|
||||
filename = title
|
||||
return scu.send_file(xls, filename, scu.XLSX_SUFFIX, scu.XLSX_MIMETYPE)
|
||||
else:
|
||||
raise ValueError("unsupported format")
|
||||
|
@ -328,7 +328,7 @@ def feuille_preparation_jury(formsemestre_id, REQUEST):
|
||||
xls = ws.generate()
|
||||
return scu.send_file(
|
||||
xls,
|
||||
f"PrepaJury{sn}{scu.XLSX_SUFFIX}",
|
||||
f"PrepaJury{sn}",
|
||||
scu.XLSX_SUFFIX,
|
||||
mime=scu.XLSX_MIMETYPE,
|
||||
)
|
||||
|
@ -231,7 +231,7 @@ def do_formsemestre_recapcomplet(
|
||||
return data
|
||||
elif format == "csv":
|
||||
return scu.send_file(data, filename=filename, mime=scu.CSV_MIMETYPE)
|
||||
elif format[:3] == "xls" or format[:3] == "xlsx":
|
||||
elif format[:3] == "xls" or format[:4] == "xlsx":
|
||||
return scu.send_file(data, filename=filename, mime=scu.XLSX_MIMETYPE)
|
||||
elif format == "json":
|
||||
js = json.dumps(data, indent=1, cls=scu.ScoDocJSONEncoder)
|
||||
|
Loading…
Reference in New Issue
Block a user