From 1a9862f472479768bafa9479bd9f5bc1cb3283c9 Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Sun, 22 Aug 2021 17:43:02 +0200 Subject: [PATCH] Ajout titre page import utilisateur --- app/views/users.py | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/app/views/users.py b/app/views/users.py index 983ab5a4c..3cd5af136 100644 --- a/app/views/users.py +++ b/app/views/users.py @@ -469,7 +469,7 @@ def create_user_form(REQUEST, user_name=None, edit=0): def import_users_generate_excel_sample(REQUEST): "une feuille excel pour importation utilisateurs" data = sco_import_users.generate_excel_sample() - return sco_excel.send_excel_file(REQUEST, data, "ImportUtilisateurs") + return sco_excel.send_excel_file(REQUEST, data, "ImportUtilisateurs.xlsx") @bp.route("/import_users_form", methods=["GET", "POST"]) @@ -523,16 +523,20 @@ def import_users_form(REQUEST=None): if tf[0] == 0: return "\n".join(H) + tf[1] + "" + help + F elif tf[0] == -1: - return flask.redirect(back_url) + return flask.redirect(url_for("scodoc.index")) else: # IMPORT ok, diag = sco_import_users.import_excel_file(tf[2]["xlsfile"]) - # TODO Afficher la liste des messages - H = [html_sco_header.sco_header(page_title="Import utilisateurs")] - H.append("") + H = [ + html_sco_header.sco_header(page_title="Import utilisateurs"), + """

Téléchargement d'une nouvelle liste d'utilisateurs

+ """, + ] + if diag: + H.append("""

Problèmes rencontrés:

") if ok: dest = url_for("users.index_html", scodoc_dept=g.scodoc_dept) H.append("

Ok, Import terminé !

") @@ -542,7 +546,6 @@ def import_users_form(REQUEST=None): H.append("

Erreur, importation annulée !

") H.append('

Continuer

' % dest) return "\n".join(H) + html_sco_header.sco_footer() - return "\n".join(H) + help + F @bp.route("/user_info_page")