From 5d0bed11c2d36a4e8b49b58d503f348087c2297f Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Fri, 23 Jul 2021 17:57:17 +0200 Subject: [PATCH] sneed --- drama/routes/admin.py | 9 --------- drama/routes/users.py | 8 ++++++++ 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/drama/routes/admin.py b/drama/routes/admin.py index 62cbe5c98..99eda3f18 100644 --- a/drama/routes/admin.py +++ b/drama/routes/admin.py @@ -964,15 +964,6 @@ def admin_distinguish_comment(c_id, v): return jsonify({"html":html, "api":html}) - -@app.route("/admin/dump_cache", methods=["GET"]) -@admin_level_required(3) -@validate_formkey -def admin_dump_cache(v): - cache.clear() - return jsonify({"message": "Internal cache cleared."}) - - @app.route("/admin/ban_domain", methods=["POST"]) @admin_level_required(4) @validate_formkey diff --git a/drama/routes/users.py b/drama/routes/users.py index 500ccc8c9..3b49d9fa9 100644 --- a/drama/routes/users.py +++ b/drama/routes/users.py @@ -26,6 +26,14 @@ def user_info(v, username): user = get_user(username, v=v) return jsonify(user.json) +@app.route("/admin/dump_cache", methods=["GET"]) +@admin_level_required(3) +@validate_formkey +def admin_dump_cache(v): + cache.delete_memoized(leaderboard) + cache.clear() + return jsonify({"message": "Internal cache cleared."}) + @app.route("/leaderboard", methods=["GET"]) @auth_desired def leaderboard(v):