master
Aevann1 2022-01-14 14:09:05 +02:00
parent 3ab53cad82
commit 6c00126695
2 changed files with 5 additions and 5 deletions

View File

@ -63,7 +63,7 @@ def post_pid_comment_cid(cid, pid=None, anything=None, v=None):
if post.over_18 and not (v and v.over_18) and not session.get('over_18', 0) >= int(time.time()):
if request.headers.get("Authorization"): return {'error': 'This content is not suitable for some users and situations.'}
else: render_template(f"{template2}errors/nsfw.html", v=v)
else: render_template("errors/nsfw.html", v=v)
try: context = int(request.values.get("context", 0))
except: context = 0
@ -126,7 +126,7 @@ def post_pid_comment_cid(cid, pid=None, anything=None, v=None):
else:
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(f"{template2}{template}", v=v, p=post, sort=sort, linked_comment=comment, comment_info=comment_info, render_replies=True)
return render_template(template, v=v, p=post, sort=sort, linked_comment=comment, comment_info=comment_info, render_replies=True)
@app.post("/comment")

View File

@ -226,13 +226,13 @@ def post_id(pid, anything=None, v=None):
g.db.add(post)
if request.host != 'old.rdrama.net' and post.over_18 and not (v and v.over_18) and session.get('over_18', 0) < int(time.time()):
if request.headers.get("Authorization"): return {"error":"Must be 18+ to view"}, 451
return render_template(f"{template2}errors/nsfw.html", v=v)
return render_template("errors/nsfw.html", v=v)
g.db.commit()
if request.headers.get("Authorization"): return post.json
else:
if post.is_banned and not (v and (v.admin_level > 1 or post.author_id == v.id)): template = f"{template2}submission_banned.html"
else: template = f"{template2}submission.html"
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, sort=sort, render_replies=True, offset=offset)
@app.post("/viewmore/<pid>/<sort>/<offset>")