diff --git a/files/routes/comments.py b/files/routes/comments.py index e7efc84d3..1a8519500 100644 --- a/files/routes/comments.py +++ b/files/routes/comments.py @@ -71,6 +71,8 @@ def post_pid_comment_cid(cid, pid=None, anything=None, v=None, sub=None): if not v and not request.path.startswith('/logged_out'): return redirect(f"{SITE_FULL}/logged_out{request.full_path}") + if v and request.path.startswith('/logged_out'): v = None + try: cid = int(cid) except: abort(404) diff --git a/files/routes/posts.py b/files/routes/posts.py index fb681c3bc..94ba3faea 100644 --- a/files/routes/posts.py +++ b/files/routes/posts.py @@ -152,6 +152,8 @@ def post_id(pid, anything=None, v=None, sub=None): if not v and not request.path.startswith('/logged_out') and not request.headers.get("Authorization"): return redirect(f"{SITE_FULL}/logged_out{request.full_path}") + if v and request.path.startswith('/logged_out'): v = None + try: pid = int(pid) except Exception as e: pass diff --git a/files/routes/static.py b/files/routes/static.py index 83ad72b10..d46b136b5 100644 --- a/files/routes/static.py +++ b/files/routes/static.py @@ -40,6 +40,8 @@ def marsey_list(): def terms(v): if not v and not request.path.startswith('/logged_out'): return redirect(f"{SITE_FULL}/logged_out{request.full_path}") + if v and request.path.startswith('/logged_out'): v = None + return render_template("terms.html", v=v) @app.get('/sidebar') @@ -48,6 +50,8 @@ def terms(v): def sidebar(v): if not v and not request.path.startswith('/logged_out'): return redirect(f"{SITE_FULL}/logged_out{request.full_path}") + if v and request.path.startswith('/logged_out'): v = None + return render_template('sidebar.html', v=v) diff --git a/files/routes/users.py b/files/routes/users.py index c149a0845..037a1057b 100644 --- a/files/routes/users.py +++ b/files/routes/users.py @@ -689,6 +689,7 @@ def u_username(username, v=None): if not v and not request.path.startswith('/logged_out'): return redirect(f"{SITE_FULL}/logged_out{request.full_path}") + if v and request.path.startswith('/logged_out'): v = None u = get_user(username, v=v) @@ -786,6 +787,8 @@ def u_username_comments(username, v=None): if not v and not request.path.startswith('/logged_out'): return redirect(f"{SITE_FULL}/logged_out{request.full_path}") + if v and request.path.startswith('/logged_out'): v = None + user = get_user(username, v=v) if username != user.username: return redirect(f'{SITE_FULL}/@{user.username}/comments') @@ -971,6 +974,8 @@ def remove_follow(username, v): def user_profile_uid(v, id): if not v and not request.path.startswith('/logged_out'): return redirect(f"{SITE_FULL}/logged_out{request.full_path}") + if v and request.path.startswith('/logged_out'): v = None + x=get_account(id) return redirect(x.profile_url)