1
0
forked from ScoDoc/ScoDoc

Merge pull request 'migration photo_import_from_zip' (#103) from jmplace/ScoDoc-Lille:scodoc9_photo_import into master

Reviewed-on: https://scodoc.org/git/viennet/ScoDoc/pulls/103
This commit is contained in:
Emmanuel Viennet 2021-08-20 09:59:34 +02:00
commit 64db24613d
2 changed files with 2 additions and 1 deletions

View File

@ -582,7 +582,7 @@ def zip_excel_import_files(
exceldata = xlsfile.read() exceldata = xlsfile.read()
if not exceldata: if not exceldata:
raise ScoValueError("Fichier excel vide ou invalide") raise ScoValueError("Fichier excel vide ou invalide")
_, data = sco_excel.Excel_to_list(exceldata) _, data = sco_excel.excel_bytes_to_list(exceldata)
if not data: # probably a bug if not data: # probably a bug
raise ScoValueError("Fichier excel vide !") raise ScoValueError("Fichier excel vide !")
# on doit avoir une colonne etudid et une colonne filename_title ('fichier_photo') # on doit avoir une colonne etudid et une colonne filename_title ('fichier_photo')

View File

@ -2094,6 +2094,7 @@ sco_publish(
"/photos_import_files_form", "/photos_import_files_form",
sco_trombino.photos_import_files_form, sco_trombino.photos_import_files_form,
Permission.ScoEtudChangeAdr, Permission.ScoEtudChangeAdr,
methods=["GET", "POST"],
) )
sco_publish( sco_publish(
"/photos_generate_excel_sample", "/photos_generate_excel_sample",