From 457a717075a0a13a8645639ab76c4334c9ebf325 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Sun, 24 Apr 2022 00:09:25 +0200 Subject: [PATCH] fds --- files/helpers/const.py | 1 + files/routes/comments.py | 2 -- files/routes/posts.py | 2 -- files/routes/settings.py | 1 - files/routes/static.py | 2 +- files/routes/users.py | 2 +- 6 files changed, 3 insertions(+), 7 deletions(-) diff --git a/files/helpers/const.py b/files/helpers/const.py index 25bd8a2c45..d10003fb87 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 b226414a33..b7bf61c8b2 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 aaf56608fa..2b341115d4 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 ef9d5733ee..b1f16ae5ec 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 92a773d863..5e647d6c3c 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 918346ad26..521c3390fa 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'