Aevann 2023-07-27 03:35:44 +03:00
parent d62b72ff31
commit 46d24cddfc
1 changed files with 1 additions and 2 deletions

View File

@ -98,8 +98,7 @@ def post_id(pid, v, anything=None, sub=None):
p = get_post(pid, v=v)
if not User.can_see(v, p): abort(403)
if p.over_18 and not (v and v.over_18) and session.get('over_18_cookies', 0) < int(time.time()):
if g.is_api_or_xhr: abort(451, "Must be 18+ to view")
if not g.is_api_or_xhr and p.over_18 and not (v and v.over_18) and session.get('over_18_cookies', 0) < int(time.time()):
return render_template("errors/nsfw.html", v=v)
gevent.spawn(_add_post_view, pid)