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 %} +
重置选中用户的信息