routes: added various per-app exclusions (#128)

Kindly,

Why (at least on WPD):
* /marseys results in a 500 (balls-deep)
* /worldcup... and /directory are empty pages
* /toggle_holes results in almost all posts getting removed from the front page in the perspective of the logged-in user

Thanks,
granny

Reviewed-on: #128
Co-authored-by: mummified-corroding-granny <mummified-corroding-granny@noreply.fsdfsd.net>
Co-committed-by: mummified-corroding-granny <mummified-corroding-granny@noreply.fsdfsd.net>
pull/130/head
mummified-corroding-granny 2023-02-20 14:40:21 +00:00 committed by Aevann
parent 6f06b24ead
commit 4e52488b35
3 changed files with 12 additions and 0 deletions

View File

@ -82,6 +82,9 @@ def _special_leaderboard_get():
@app.get('/special/worldcup2022/leaderboard')
@auth_required
def get_leaderboard(v):
if SITE_NAME != 'rDrama':
abort(404)
result = _special_leaderboard_get()
if g.is_api_or_xhr: return result
users = get_accounts_dict([r[0] for r in result],

View File

@ -43,6 +43,9 @@ def reddit_post(subreddit, v, path):
@auth_required
def marseys(v:User):
if SITE_NAME != 'rDrama':
abort(404)
marseys = get_marseys(g.db)
authors = get_accounts_dict([m.author_id for m in marseys], v=v, graceful=True, include_shadowbanned=False)
original = os.listdir("/asset_submissions/marseys/original")
@ -198,6 +201,9 @@ def log_item(id, v):
@limiter.limit(DEFAULT_RATELIMIT, key_func=get_ID)
@auth_required
def static_megathread_index(v:User):
if SITE_NAME != 'rDrama':
abort(404)
return render_template("megathread_index.html", v=v)
@app.get("/api")

View File

@ -1234,6 +1234,9 @@ def toggle_pins(sort):
@app.get("/toggle_holes")
def toggle_holes():
if SITE_NAME == 'WPD':
abort(404)
holes = session.get('holes', True)
session["holes"] = not holes