diff --git a/files/helpers/const.py b/files/helpers/const.py index 25bd8a2c4..d10003fb8 100644 --- a/files/helpers/const.py +++ b/files/helpers/const.py @@ -252,6 +252,7 @@ else: BUG_THREAD = 0 WELCOME_MSG = f"Welcome to {SITE_NAME}!" +IMGUR_KEY = environ.get("IMGUR_KEY").strip() PUSHER_ID = environ.get("PUSHER_ID", "").strip() PUSHER_KEY = environ.get("PUSHER_KEY", "").strip() DEFAULT_COLOR = environ.get("DEFAULT_COLOR", "fff").strip() diff --git a/files/routes/comments.py b/files/routes/comments.py index b226414a3..b7bf61c8b 100644 --- a/files/routes/comments.py +++ b/files/routes/comments.py @@ -22,8 +22,6 @@ from sys import stdout d = Dict("en_US") -IMGUR_KEY = environ.get("IMGUR_KEY").strip() - if PUSHER_ID != 'blahblahblah': beams_client = PushNotifications(instance_id=PUSHER_ID, secret_key=PUSHER_KEY) diff --git a/files/routes/posts.py b/files/routes/posts.py index aaf56608f..2b341115d 100644 --- a/files/routes/posts.py +++ b/files/routes/posts.py @@ -27,8 +27,6 @@ if path.exists(f'snappy_{SITE_NAME}.txt'): with open(f'snappy_{SITE_NAME}.txt', "r", encoding="utf-8") as f: snappyquotes += f.read().split("\n{[para]}\n") -IMGUR_KEY = environ.get("IMGUR_KEY").strip() - discounts = { 69: 0.02, 70: 0.04, diff --git a/files/routes/settings.py b/files/routes/settings.py index ef9d5733e..b1f16ae5e 100644 --- a/files/routes/settings.py +++ b/files/routes/settings.py @@ -14,7 +14,6 @@ from shutil import copyfile import requests GUMROAD_TOKEN = environ.get("GUMROAD_TOKEN", "").strip() -IMGUR_KEY = environ.get("IMGUR_KEY").strip() GUMROAD_ID = environ.get("GUMROAD_ID", "tfcvri").strip() tiers={ diff --git a/files/routes/static.py b/files/routes/static.py index 92a773d86..5e647d6c3 100644 --- a/files/routes/static.py +++ b/files/routes/static.py @@ -132,7 +132,7 @@ def stats(): } @app.get("/chart") -def chart(v): +def chart(): return redirect('/weekly_chart') diff --git a/files/routes/users.py b/files/routes/users.py index 918346ad2..521c3390f 100644 --- a/files/routes/users.py +++ b/files/routes/users.py @@ -673,7 +673,7 @@ def messagereply(v): body_html = sanitize(message) - if request.files.get("file") and request.headers.get("cf-ipcountry") != "T1": + if v.admin_level > 1 and request.files.get("file") and request.headers.get("cf-ipcountry") != "T1": file=request.files["file"] if file.content_type.startswith('image/'): name = f'/images/{time.time()}'.replace('.','') + '.webp'