master
Aevann1 2021-12-20 14:33:44 +02:00
parent efff0400ef
commit 79fc26b937
1 changed files with 5 additions and 2 deletions

View File

@ -33,6 +33,9 @@ def post_pid_comment_cid(cid, pid=None, anything=None, v=None):
if v and request.path.startswith('/logged_out'): v = None
if not v or v.oldsite: template2 = ''
else: template2 = 'CHRISTMAS/'
try: cid = int(cid)
except:
try: cid = int(cid, 36)
@ -64,7 +67,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': f'This content is not suitable for some users and situations.'}
else: render_template("errors/nsfw.html", v=v)
else: render_template(f"{template2}errors/nsfw.html", v=v)
try: context = int(request.values.get("context", 0))
except: context = 0
@ -127,7 +130,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(template, v=v, p=post, sort=sort, linked_comment=comment, comment_info=comment_info, render_replies=True)
return render_template(f"{template2}{template}", v=v, p=post, sort=sort, linked_comment=comment, comment_info=comment_info, render_replies=True)
@app.post("/comment")