diff --git a/files/routes/static.py b/files/routes/static.py index ba0a0fe43..5f52974ed 100644 --- a/files/routes/static.py +++ b/files/routes/static.py @@ -278,7 +278,7 @@ def submit_contact(v): body = request.values.get("message") if not body: abort(400) - body = f'This message has been sent automatically to all admins via [/contact](/contact), user email is "{v.email}"\n\nMessage:\n\n' + body + body = f'This message has been sent automatically to all admins via [/contact](/contact)\n\nMessage:\n\n' + body body_html = sanitize(body, noimages=True) if request.files.get("file") and request.headers.get("cf-ipcountry") != "T1": diff --git a/files/routes/subs.py b/files/routes/subs.py index 7bad61979..b198099b7 100644 --- a/files/routes/subs.py +++ b/files/routes/subs.py @@ -7,7 +7,7 @@ from .front import frontlist valid_sub_regex = re.compile("^[a-zA-Z0-9_\-]{3,25}$") @app.get("/s//mods") -@auth_required +@is_not_permabanned def mods(v, sub): sub = g.db.query(Sub).filter_by(name=sub.lower()).one_or_none() if not sub: abort(404) @@ -18,7 +18,7 @@ def mods(v, sub): @app.post("/s//add_mod") -@auth_required +@is_not_permabanned def add_mod(v, sub): sub = g.db.query(Sub).filter_by(name=sub.lower()).one_or_none() if not sub: abort(404) @@ -43,13 +43,13 @@ def add_mod(v, sub): @app.get("/create_sub") -@auth_required +@is_not_permabanned def create_sub(v): return render_template("sub/create_sub.html", v=v) @app.post("/create_sub") -@auth_required +@is_not_permabanned def create_sub2(v): name = request.values.get('name') if not name: abort(400) @@ -77,7 +77,7 @@ def create_sub2(v): return redirect(f'/s/{sub.name}') @app.post("/kick/") -@auth_required +@is_not_permabanned def kick(v, pid): try: pid = int(pid) except: abort(400) @@ -97,7 +97,7 @@ def kick(v, pid): @app.get('/s//settings') -@auth_required +@is_not_permabanned def sub_settings(v, sub): sub = g.db.query(Sub).filter_by(name=sub.strip().lower()).one_or_none() if not sub: abort(404) @@ -109,7 +109,7 @@ def sub_settings(v, sub): @app.post('/s//sidebar') @limiter.limit("1/second;30/minute;200/hour;1000/day") -@auth_required +@is_not_permabanned def post_sub_sidebar(v, sub): sub = g.db.query(Sub).filter_by(name=sub.lower()).one_or_none() if not sub: abort(404) @@ -133,7 +133,7 @@ def post_sub_sidebar(v, sub): @app.post("/s//banner") @limiter.limit("1/second;30/minute;200/hour;1000/day") -@auth_required +@is_not_permabanned def sub_banner(v, sub): if v and v.patron: if request.content_length > 8 * 1024 * 1024: return {"error":"Max file size is 8 MB."}, 413 @@ -164,7 +164,7 @@ def sub_banner(v, sub): @app.post("/s//sidebar_image") @limiter.limit("1/second;30/minute;200/hour;1000/day") -@auth_required +@is_not_permabanned def sub_sidebar(v, sub): if v and v.patron: if request.content_length > 8 * 1024 * 1024: return {"error":"Max file size is 8 MB."}, 413 @@ -190,12 +190,4 @@ def sub_sidebar(v, sub): g.db.add(sub) g.db.commit() - return redirect(f'/s/{sub.name}/settings') - - -#mods id seq -#css -#exile -#guild mod log -#remove mod -#search sub \ No newline at end of file + return redirect(f'/s/{sub.name}/settings') \ No newline at end of file diff --git a/files/templates/default.html b/files/templates/default.html index d0c99126d..8adc75f34 100644 --- a/files/templates/default.html +++ b/files/templates/default.html @@ -225,7 +225,7 @@ {% elif sub %} - sub banner + /s/{[sub.name]} banner {% else %} @@ -276,7 +276,7 @@ {% endblock %} - {% if home %} + {% if home or sub and (request.path.startswith('/post') or request.path.startswith('/comment')) %} {% block sidebar %} {% include "sidebar_" + SITE_NAME + ".html" %} {% endblock %} diff --git a/files/templates/header.html b/files/templates/header.html index 499d17261..c57569f2a 100644 --- a/files/templates/header.html +++ b/files/templates/header.html @@ -35,7 +35,7 @@ {% set icon = ('marseyblm','marseykween','marseydynamite','marseyblack','marseymyeisha','marseyetika','marseyobama','marseyblackcop','marseysosa','marseyblackface')|random() %} header icon {% else %} - header icon + header icon {% endif %} {% if SITE_NAME == 'Drama' %} diff --git a/files/templates/sub/settings.html b/files/templates/sub/settings.html index ec617343a..749a5c0b7 100644 --- a/files/templates/sub/settings.html +++ b/files/templates/sub/settings.html @@ -57,7 +57,7 @@