From 3bc61a602f1ae4d7675e75dbecc4a3616ce63dd5 Mon Sep 17 00:00:00 2001 From: Lan Hui <1348141770@qq.com> Date: Sun, 26 Mar 2023 09:44:39 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=96=87=E7=AB=A0=E6=88=90?= =?UTF-8?q?=E5=8A=9F=E5=90=8E=EF=BC=8C=E4=BF=AE=E6=94=B9=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=E6=88=90=E5=8A=9F=E5=90=8E=EF=BC=8C=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E6=98=BE=E7=A4=BA=E6=88=90=E5=8A=9F=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=EF=BC=88flash=20messages=EF=BC=89=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/admin_service.py | 8 +++++--- app/templates/admin_manage_article.html | 6 ++++++ app/templates/admin_manage_user.html | 6 ++++++ 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/app/admin_service.py b/app/admin_service.py index 92150bd..8632b43 100644 --- a/app/admin_service.py +++ b/app/admin_service.py @@ -97,7 +97,8 @@ def article(): return "Level must be between 1 and 5" add_article(content, source, level, question) _update_context() - + title = content.split('\n')[0] + flash(f'Article added. Title: {title}') return render_template("admin_manage_article.html", **context) @@ -119,7 +120,8 @@ def user(): if username: if new_password: update_password_by_username(username, new_password) + flash(f'Password updated to {new_password}') if expiry_time: update_expiry_time_by_username(username, "".join(expiry_time.split("-"))) - - return render_template("admin_manage_user.html", **context) \ No newline at end of file + flash(f'Expiry date updated to {expiry_time}.') + return render_template("admin_manage_user.html", **context) diff --git a/app/templates/admin_manage_article.html b/app/templates/admin_manage_article.html index 99c2ef6..7e476e6 100644 --- a/app/templates/admin_manage_article.html +++ b/app/templates/admin_manage_article.html @@ -30,6 +30,12 @@ + {% for message in get_flashed_messages() %} + + {% endfor %} +
{% if tips %} + {% for message in get_flashed_messages() %} + + {% endfor %} +
重置选中用户的信息