site settings

This commit is contained in:
Aevann1 2022-04-12 21:05:50 +02:00
parent 442355bde7
commit 265a13a601
11 changed files with 116 additions and 109 deletions

View file

@ -253,13 +253,9 @@ def post_id(pid, anything=None, v=None, sub=None):
g.db.commit()
if request.headers.get("Authorization"): return post.json
else:
with open('fart_mode', 'r') as f:
if f.read() == "yes": fart = True
else: fart = False
if post.is_banned and not (v and (v.admin_level > 1 or post.author_id == v.id)): template = "submission_banned.html"
else: template = "submission.html"
return render_template(template, v=v, p=post, ids=list(ids), sort=sort, render_replies=True, offset=offset, sub=post.subr, fart=fart)
return render_template(template, v=v, p=post, ids=list(ids), sort=sort, render_replies=True, offset=offset, sub=post.subr, fart=app.config['SETTINGS']['Fart mode'])
@app.get("/viewmore/<pid>/<sort>/<offset>")
@limiter.limit("1/second;30/minute;200/hour;1000/day")