testing done

master
Aevann1 2022-09-17 22:25:15 +02:00
parent eee6058330
commit 6ff943914e
2 changed files with 4 additions and 11 deletions

View File

@ -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!"}

View File

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