From df702a43493d7e2fb646424d8e2b78ec7d0232dd Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Mon, 28 Feb 2022 22:33:07 +0200 Subject: [PATCH] messy --- files/routes/subs.py | 74 +++++++++++++++--------------- files/templates/sidebar_Drama.html | 4 +- files/templates/sidebar_PCM.html | 2 +- 3 files changed, 40 insertions(+), 40 deletions(-) diff --git a/files/routes/subs.py b/files/routes/subs.py index 0a82ee041..ca960dd54 100644 --- a/files/routes/subs.py +++ b/files/routes/subs.py @@ -252,53 +252,53 @@ def remove_mod(v, sub): return redirect(f'/s/{sub}/mods') -@app.get("/create_sub") -@is_not_permabanned -def create_sub(v): - if v.id == MENTION_ID: cost = 0 - else: - num = v.subs_created + 1 - for a in v.alts: - num += a.subs_created - cost = num * 100 +# @app.get("/create_sub") +# @is_not_permabanned +# def create_sub(v): +# if v.id == MENTION_ID: 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") -@is_not_permabanned -def create_sub2(v): - name = request.values.get('name') - if not name: abort(400) - name = name.strip().lower() +# @app.post("/create_sub") +# @is_not_permabanned +# def create_sub2(v): +# name = request.values.get('name') +# if not name: abort(400) +# name = name.strip().lower() - if not valid_sub_regex.fullmatch(name): - return render_template("sub/create_sub.html", v=v, error="Sub name not allowed."), 400 +# if not valid_sub_regex.fullmatch(name): +# return render_template("sub/create_sub.html", v=v, error="Sub name not allowed."), 400 - sub = g.db.query(Sub).filter_by(name=name).one_or_none() - if not sub: - if v.id != MENTION_ID: - num = v.subs_created + 1 - for a in v.alts: - num += a.subs_created - cost = num * 100 +# sub = g.db.query(Sub).filter_by(name=name).one_or_none() +# if not sub: +# if v.id != MENTION_ID: +# num = v.subs_created + 1 +# for a in v.alts: +# num += a.subs_created +# cost = num * 100 - if v.coins < cost: - return render_template("sub/create_sub.html", v=v, error="You don't have enough coins!"), 403 +# if v.coins < cost: +# return render_template("sub/create_sub.html", v=v, error="You don't have enough coins!"), 403 - v.coins -= cost +# v.coins -= cost - v.subs_created += 1 - g.db.add(v) +# v.subs_created += 1 +# g.db.add(v) - sub = Sub(name=name) - g.db.add(sub) - g.db.flush() - mod = Mod(user_id=v.id, sub=sub.name) - g.db.add(mod) - g.db.commit() +# sub = Sub(name=name) +# g.db.add(sub) +# g.db.flush() +# mod = Mod(user_id=v.id, sub=sub.name) +# g.db.add(mod) +# g.db.commit() - return redirect(f'/s/{sub.name}') +# return redirect(f'/s/{sub.name}') @app.post("/kick/") @is_not_permabanned diff --git a/files/templates/sidebar_Drama.html b/files/templates/sidebar_Drama.html index c1c7cc206..1a2bcd28a 100644 --- a/files/templates/sidebar_Drama.html +++ b/files/templates/sidebar_Drama.html @@ -13,7 +13,7 @@ {% if sub.sidebar_html %}
{{sub.sidebar_html|safe}}
{% endif %} - CREATE SUB + {% if v and v.mods(sub.name) %} SUB SETTINGS {% endif %} @@ -25,7 +25,7 @@ EXILEES BLOCKERS {% else %} - CREATE SUB + EMOJI MEGATHREAD BUGS/SUGGESTIONS MEGATHREAD SIDEBAR ARTWORK MEGATHREAD diff --git a/files/templates/sidebar_PCM.html b/files/templates/sidebar_PCM.html index 81993dc09..cbde5033b 100644 --- a/files/templates/sidebar_PCM.html +++ b/files/templates/sidebar_PCM.html @@ -16,7 +16,7 @@ BLOCKERS {% endif %} -CREATE SUB + STREAM LIST BUGS/SUGGESTIONS MEGATHREAD OFFICIAL CONSPIRACY THEORY THREAD