master
Aevann1 2022-01-24 21:06:41 +02:00
parent 7c8daa0326
commit d808a5c0a5
3 changed files with 4 additions and 5 deletions

View File

@ -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 == "<Response [200]>": return {"message": "Cache purged!"}
return {"error": "Failed to purge cache."}

View File

@ -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")

View File

@ -86,7 +86,7 @@
</div>
</div>
<script src="/static/assets/js/emoji_modal.js?a=233"></script>
<script src="/static/assets/js/emoji_modal.js?a=234"></script>
<style>
a.emojitab {