forked from rDrama/rDrama
1
0
Fork 0

make logged_out-cels count towards post view counts again

master
Aevann 2023-05-12 22:40:34 +03:00
parent 1d1f3d1a3b
commit dfe5fdcea1
1 changed files with 3 additions and 3 deletions

View File

@ -95,6 +95,9 @@ def post_id(pid, anything=None, v=None, sub=None):
if g.is_api_or_xhr: abort(451, "Must be 18+ to view")
return render_template("errors/nsfw.html", v=v)
p.views += 1
g.db.add(p)
if not v and not request.values.get("sort"):
result = cache.get(f'post_{p.id}')
if result: return result
@ -166,9 +169,6 @@ def post_id(pid, anything=None, v=None, sub=None):
p.replies = list(pinned2.keys()) + comments
p.views += 1
g.db.add(p)
if v and v.client:
return p.json(g.db)