From 051b35a02897f6d131bf00ecbe7a635239a66d26 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Mon, 9 May 2022 04:16:28 +0200 Subject: [PATCH 1/3] sf --- files/routes/subs.py | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/files/routes/subs.py b/files/routes/subs.py index 5aeaeecfaa..6004a938ac 100644 --- a/files/routes/subs.py +++ b/files/routes/subs.py @@ -220,19 +220,21 @@ def remove_mod(v, sub): return redirect(f'/h/{sub}/mods') -# @app.get("/create_sub") -# @is_not_permabanned -# def create_sub(v): -# if SITE_NAME == 'rDrama' and v.admin_level < 3: abort(403) +@app.get("/create_sub") +@is_not_permabanned +def create_sub(v): + if SITE_NAME == 'Cringetopia': abort(403) -# if request.host == 'rdrama.net': cost = 0 -# else: -# num = v.subs_created + 1 -# for a in v.alts: -# num += a.subs_created -# cost = num * 100 + if SITE_NAME == 'rDrama' and v.admin_level < 3: abort(403) + + if request.host == 'rdrama.net': cost = 0 + else: + num = v.subs_created + 1 + for a in v.alts: + num += a.subs_created + cost = num * 100 -# return render_template("sub/create_sub.html", v=v, cost=cost) + return render_template("sub/create_sub.html", v=v, cost=cost) @app.post("/create_sub") From 71890a2dd17959139f39f3e77a4a696b25780e44 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Mon, 9 May 2022 10:47:35 +0200 Subject: [PATCH 2/3] sfd --- files/routes/comments.py | 2 +- files/routes/front.py | 2 +- files/routes/posts.py | 2 +- files/routes/static.py | 2 +- files/routes/users.py | 6 +++--- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/files/routes/comments.py b/files/routes/comments.py index 05d20b93f7..9d00b72a86 100644 --- a/files/routes/comments.py +++ b/files/routes/comments.py @@ -68,7 +68,7 @@ def pusher_thread(interests, c, username): 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"/logged_out{request.full_path}") - if v and request.path.startswith('/logged_out'): v = None + if v and request.path.startswith('/logged_out'): return redirect(request.full_path.replace('/logged_out','')) try: cid = int(cid) except: abort(404) diff --git a/files/routes/front.py b/files/routes/front.py index d3d03586a3..43b82221b9 100644 --- a/files/routes/front.py +++ b/files/routes/front.py @@ -173,7 +173,7 @@ def front_all(v, sub=None, subdomain=None): session["session_id"] = secrets.token_hex(49) if not v and not request.path.startswith('/logged_out'): return redirect(f"/logged_out{request.full_path}") - if v and request.path.startswith('/logged_out'): v = None + if v and request.path.startswith('/logged_out'): return redirect(request.full_path.replace('/logged_out','')) if sub: sub = g.db.query(Sub).filter_by(name=sub.strip().lower()).one_or_none() diff --git a/files/routes/posts.py b/files/routes/posts.py index 61861347cf..a238b3e6fa 100644 --- a/files/routes/posts.py +++ b/files/routes/posts.py @@ -120,7 +120,7 @@ def submit_get(v, sub=None): def post_id(pid, anything=None, v=None, sub=None): if not v and not request.path.startswith('/logged_out'): return redirect(f"/logged_out{request.full_path}") - if v and request.path.startswith('/logged_out'): v = None + if v and request.path.startswith('/logged_out'): return redirect(request.full_path.replace('/logged_out','')) try: pid = int(pid) except Exception as e: pass diff --git a/files/routes/static.py b/files/routes/static.py index 4c212e669b..404d4eadda 100644 --- a/files/routes/static.py +++ b/files/routes/static.py @@ -62,7 +62,7 @@ def marsey_list(): @auth_desired def sidebar(v): if not v and not request.path.startswith('/logged_out'): return redirect(f"/logged_out{request.full_path}") - if v and request.path.startswith('/logged_out'): v = None + if v and request.path.startswith('/logged_out'): return redirect(request.full_path.replace('/logged_out','')) return render_template('sidebar.html', v=v) diff --git a/files/routes/users.py b/files/routes/users.py index 302abecea9..6380d1db87 100644 --- a/files/routes/users.py +++ b/files/routes/users.py @@ -864,7 +864,7 @@ def visitors(v): def u_username(username, v=None): if not v and not request.path.startswith('/logged_out'): return redirect(f"/logged_out{request.full_path}") - if v and request.path.startswith('/logged_out'): v = None + if v and request.path.startswith('/logged_out'): return redirect(request.full_path.replace('/logged_out','')) u = get_user(username, v=v) @@ -953,7 +953,7 @@ def u_username(username, v=None): def u_username_comments(username, v=None): if not v and not request.path.startswith('/logged_out'): return redirect(f"/logged_out{request.full_path}") - if v and request.path.startswith('/logged_out'): v = None + if v and request.path.startswith('/logged_out'): return redirect(request.full_path.replace('/logged_out','')) user = get_user(username, v=v) @@ -1145,7 +1145,7 @@ def remove_follow(username, v): @auth_desired def user_profile_uid(v, id): if not v and not request.path.startswith('/logged_out'): return redirect(f"/logged_out{request.full_path}") - if v and request.path.startswith('/logged_out'): v = None + if v and request.path.startswith('/logged_out'): return redirect(request.full_path.replace('/logged_out','')) try: id = int(id) except: From 5fddfae64cc326298acd20f8b9a1cb9c498d1b89 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Mon, 9 May 2022 11:08:26 +0200 Subject: [PATCH 3/3] sf --- files/routes/subs.py | 4 +--- files/templates/sidebar_Cringetopia.html | 4 ---- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/files/routes/subs.py b/files/routes/subs.py index 6004a938ac..09def2747f 100644 --- a/files/routes/subs.py +++ b/files/routes/subs.py @@ -223,9 +223,7 @@ def remove_mod(v, sub): @app.get("/create_sub") @is_not_permabanned def create_sub(v): - if SITE_NAME == 'Cringetopia': abort(403) - - if SITE_NAME == 'rDrama' and v.admin_level < 3: abort(403) + if SITE_NAME != 'PCM' and v.admin_level < 3: abort(403) if request.host == 'rdrama.net': cost = 0 else: diff --git a/files/templates/sidebar_Cringetopia.html b/files/templates/sidebar_Cringetopia.html index 877f8d72f4..0f101bc628 100644 --- a/files/templates/sidebar_Cringetopia.html +++ b/files/templates/sidebar_Cringetopia.html @@ -13,7 +13,6 @@
{{sub.sidebar_html|safe}}
{% endif %} {% if v %} - CREATE HOLE (temporarily disabled for 24 hours) {% if v.mods(sub.name) %} HOLE SETTINGS {% endif %} @@ -22,9 +21,6 @@ HOLE EXILEES HOLE BLOCKERS {% else %} - CREATE HOLE (temporarily disabled for 24 hours) - BROWSE HOLES -
Rules: