This commit is contained in:
Aevann1 2022-02-16 01:38:33 +02:00
parent c51ca5c5b2
commit 817d63b033
5 changed files with 9 additions and 14 deletions

View file

@ -20,10 +20,6 @@ import requests
GUMROAD_ID = environ.get("GUMROAD_ID", "tfcvri").strip()
GUMROAD_TOKEN = environ.get("GUMROAD_TOKEN", "").strip()
CF_KEY = environ.get("CF_KEY", "").strip()
CF_ZONE = environ.get("CF_ZONE", "").strip()
CF_HEADERS = {"Authorization": f"Bearer {CF_KEY}", "Content-Type": "application/json"}
month = datetime.now().strftime('%B')
@ -1099,6 +1095,8 @@ def ban_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, json={'files': [f"{SITE_FULL}/logged_out/"]})
g.db.commit()
return {"message": "Post removed!"}