From 7a682d95c60616af2465aea1143b433440cec008 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Fri, 1 Jul 2022 20:19:21 +0200 Subject: [PATCH] fix 500 error --- files/routes/admin.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/files/routes/admin.py b/files/routes/admin.py index 675333c2f..0c363b259 100644 --- a/files/routes/admin.py +++ b/files/routes/admin.py @@ -470,6 +470,8 @@ def reported_comments(v): @app.get("/admin") @admin_level_required(2) def admin_home(v): + under_attack = False + if v.admin_level > 2: if CF_ZONE == 'blahblahblah': response = 'high' else: response = requests.get(f'https://api.cloudflare.com/client/v4/zones/{CF_ZONE}/settings/security_level', headers=CF_HEADERS, timeout=5).json()['result']['value'] @@ -478,7 +480,7 @@ def admin_home(v): gitref = admin_git_head() return render_template("admin/admin_home.html", v=v, - under_attack=under_attack or False, + under_attack=under_attack, site_settings=app.config['SETTINGS'], gitref=gitref)