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 v.coins += 1
g.db.add(v) g.db.add(v)
requests.post(f'https://api.cloudflare.com/client/v4/zones/{CF_ZONE}/purge_cache', requests.post(f'https://api.cloudflare.com/client/v4/zones/{CF_ZONE}/purge_cache', headers=CF_HEADERS,
headers=CF_HEADERS, data={'files': [f"{SITE_FULL}/logged_out/"]}, timeout=5) data=f'{{"files": ["https://{SITE}/logged_out"]}}', timeout=5)
return {"message": "Post removed!"} return {"message": "Post removed!"}

View File

@ -385,14 +385,7 @@ def update_marsey(v):
copyfile(new_path, filename) copyfile(new_path, filename)
process_image(filename, resize=250, trim=True) 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, requests.post(f'https://api.cloudflare.com/client/v4/zones/{CF_ZONE}/purge_cache', headers=CF_HEADERS,
data={"files": [ 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)
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)
return render_template("update_marseys.html", v=v, msg=f"'{name}' updated successfully!") return render_template("update_marseys.html", v=v, msg=f"'{name}' updated successfully!")