From f5d19d5bc4a8a5bf03772b9be6925a03c43191c4 Mon Sep 17 00:00:00 2001 From: fireworks88 Date: Mon, 13 Sep 2021 19:10:03 +0200 Subject: [PATCH 1/2] nigg --- files/routes/comments.py | 6 ++---- files/routes/posts.py | 4 ++-- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/files/routes/comments.py b/files/routes/comments.py index 52d0ac47d3..818288275e 100644 --- a/files/routes/comments.py +++ b/files/routes/comments.py @@ -27,12 +27,10 @@ beams_client = PushNotifications( @app.get("/logged_out/post///") @auth_desired def post_pid_comment_cid(cid, pid=None, anything=None, v=None): - - - if not v and "logged_out" not in request.path: return redirect(f"/logged_out/comment/{cid}") + if not v and not request.path.startswith('/logged_out'): return redirect(f"/logged_out/comment/{cid}") - if v and "logged_out" in request.full_path: v = None + if v and request.full_path.startswith('/logged_out'): v = None try: cid = int(cid) except: diff --git a/files/routes/posts.py b/files/routes/posts.py index ec6feeafb8..f8a255e542 100644 --- a/files/routes/posts.py +++ b/files/routes/posts.py @@ -78,9 +78,9 @@ def submit_get(v): @auth_desired def post_id(pid, anything=None, v=None): - if not v and "logged_out" not in request.path and not request.headers.get("Authorization"): return redirect(f"/logged_out/post/{pid}") + if not v and not request.path.startswith('/logged_out') and not request.headers.get("Authorization"): return redirect(f"/logged_out/post/{pid}") - if v and "logged_out" in request.full_path: v = None + if v and request.full_path.startswith('/logged_out'): v = None try: pid = int(pid) except Exception as e: pass From 5b77b613bfe7396cb11d2b1b449b1c946b70a43f Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Mon, 13 Sep 2021 17:11:52 +0000 Subject: [PATCH 2/2] schema --- schema.sql | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/schema.sql b/schema.sql index 050fba29fc..ebdfd97cf6 100644 --- a/schema.sql +++ b/schema.sql @@ -1058,7 +1058,8 @@ CREATE TABLE public.users ( cardview boolean, received_award_count integer, highlightcomments boolean, - club_banned boolean DEFAULT false + club_banned boolean DEFAULT false, + nitter boolean );