From d808a5c0a5f20bdc5a3b7c314a1f8474eb9a3f4d Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Mon, 24 Jan 2022 21:06:41 +0200 Subject: [PATCH] xvc --- files/routes/admin.py | 1 + files/routes/static.py | 6 ++---- files/templates/emoji_modal.html | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/files/routes/admin.py b/files/routes/admin.py index 7c29257bb..46a7cf561 100644 --- a/files/routes/admin.py +++ b/files/routes/admin.py @@ -371,6 +371,7 @@ def disable_signups(v): @app.post("/admin/purge_cache") @admin_level_required(3) def purge_cache(v): + cache.clear() response = str(requests.post(f'https://api.cloudflare.com/client/v4/zones/{CF_ZONE}/purge_cache', headers=CF_HEADERS, data='{"purge_everything":true}')) if response == "": return {"message": "Cache purged!"} return {"error": "Failed to purge cache."} diff --git a/files/routes/static.py b/files/routes/static.py index 424936721..36715d012 100644 --- a/files/routes/static.py +++ b/files/routes/static.py @@ -24,10 +24,8 @@ def marseys(v): @app.get("/marsey_list") @cache.memoize(timeout=600) def marsey_list(): - marseys = {} - for marsey, user in g.db.query(Marsey, User.username).join(User, User.id==Marsey.author_id).order_by(Marsey.count.desc()): - marseys[marsey.name] = f"{user} {marsey.tags}" - return marseys + marseys = [f"{x.name} : {y} {x.tags}" for x, y in g.db.query(Marsey, User.username).join(User, User.id==Marsey.author_id).order_by(Marsey.count.desc())] + return str(marseys).replace("'",'"') @app.get("/terms") @app.get("/logged_out/terms") diff --git a/files/templates/emoji_modal.html b/files/templates/emoji_modal.html index 78ad9bd69..949126e24 100644 --- a/files/templates/emoji_modal.html +++ b/files/templates/emoji_modal.html @@ -86,7 +86,7 @@ - +