diff --git a/app/scodoc/sco_excel.py b/app/scodoc/sco_excel.py index c15f24d4a..87debfaaf 100644 --- a/app/scodoc/sco_excel.py +++ b/app/scodoc/sco_excel.py @@ -652,13 +652,13 @@ def _excel_to_list(filelike): """returns list of list""" workbook = _open_workbook(filelike) diag = [] # liste de chaines pour former message d'erreur - if len(workbook.get_sheet_names()) < 1: + if len(workbook.sheetnames) < 1: diag.append("Aucune feuille trouvée dans le classeur !") return diag, None # n'utilise que la première feuille: - if len(workbook.get_sheet_names()) > 1: + if len(workbook.sheetnames) > 1: diag.append("Attention: n'utilise que la première feuille du classeur !") - sheet_name = workbook.get_sheet_names()[0] + sheet_name = workbook.sheetnames[0] ws = workbook[sheet_name] diag_sheet, matrix = _excel_sheet_to_list(ws, sheet_name) diag += diag_sheet @@ -707,11 +707,11 @@ def _excel_workbook_to_list(filelike): """ workbook = _open_workbook(filelike) diag = [] # liste de chaines pour former message d'erreur - if len(workbook.get_sheet_names()) < 1: + if len(workbook.sheetnames) < 1: diag.append("Aucune feuille trouvée dans le classeur !") return diag, None matrix_list = [] - for sheet_name in workbook.get_sheet_names(): + for sheet_name in workbook.sheetnames: # fill matrix sheet = workbook.get_sheet_by_name(sheet_name) diag_sheet, matrix = _excel_sheet_to_list(sheet, sheet_name) diff --git a/tests/unit/test_etudiants.py b/tests/unit/test_etudiants.py index 8344c1435..ce96c6024 100644 --- a/tests/unit/test_etudiants.py +++ b/tests/unit/test_etudiants.py @@ -180,8 +180,3 @@ def test_import_etuds_xlsx(test_client): assert adresse.telephone == "102030405" assert adresse.telephonemobile == "605040302" # - - -# mapp.set_sco_dept("TEST_") -# ctx.push() -# login_user(User.query.filter_by(user_name="admin").first())