From 6ff943914e90f5646818b0191632d0cd71f70985 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Sat, 17 Sep 2022 22:25:15 +0200 Subject: [PATCH] testing done --- files/routes/admin.py | 4 ++-- files/routes/asset_submissions.py | 11 ++--------- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/files/routes/admin.py b/files/routes/admin.py index c138ceaa3..369ed8fbd 100644 --- a/files/routes/admin.py +++ b/files/routes/admin.py @@ -1146,8 +1146,8 @@ def remove_post(post_id, v): v.coins += 1 g.db.add(v) - requests.post(f'https://api.cloudflare.com/client/v4/zones/{CF_ZONE}/purge_cache', - headers=CF_HEADERS, data={'files': [f"{SITE_FULL}/logged_out/"]}, timeout=5) + requests.post(f'https://api.cloudflare.com/client/v4/zones/{CF_ZONE}/purge_cache', headers=CF_HEADERS, + data=f'{{"files": ["https://{SITE}/logged_out"]}}', timeout=5) return {"message": "Post removed!"} diff --git a/files/routes/asset_submissions.py b/files/routes/asset_submissions.py index 3937f305c..579bfb205 100644 --- a/files/routes/asset_submissions.py +++ b/files/routes/asset_submissions.py @@ -385,14 +385,7 @@ def update_marsey(v): copyfile(new_path, filename) process_image(filename, resize=250, trim=True) - x = requests.post(f'https://api.cloudflare.com/client/v4/zones/{CF_ZONE}/purge_cache', headers=CF_HEADERS, - data={"files": [ - f"https://{SITE}/e/{name}.webp", - f"https://{SITE}/assets/images/emojis/{name}.webp", - f"https://{SITE}/asset_submissions/marseys/original/{name}.{format}" - ]}, timeout=5) - - print(x, flush=True) - print(x.text, flush=True) + requests.post(f'https://api.cloudflare.com/client/v4/zones/{CF_ZONE}/purge_cache', headers=CF_HEADERS, + data=f'{{"files": ["https://{SITE}/e/{name}.webp", "https://{SITE}/assets/images/emojis/{name}.webp", "https://{SITE}/asset_submissions/marseys/original/{name}.{format}"]}}', timeout=5) return render_template("update_marseys.html", v=v, msg=f"'{name}' updated successfully!") \ No newline at end of file