count snappy/autojanny
This commit is contained in:
parent
929193e070
commit
f34b68bf43
2 changed files with 6 additions and 4 deletions
|
@ -273,10 +273,6 @@ def api_comment(v):
|
|||
g.db.add(c)
|
||||
g.db.flush()
|
||||
|
||||
parent_post.comment_count = g.db.query(Comment).filter_by(parent_submission=parent_post.id).count()
|
||||
g.db.add(parent_post)
|
||||
g.db.flush()
|
||||
|
||||
if request.files.get("file") and request.headers.get("cf-ipcountry") != "T1":
|
||||
file=request.files["file"]
|
||||
if not file.content_type.startswith('image/'): return {"error": "That wasn't an image!"}, 400
|
||||
|
@ -511,6 +507,9 @@ def api_comment(v):
|
|||
v.comment_count = v.comments.filter(Comment.parent_submission != None).filter_by(is_banned=False, deleted_utc=0).count()
|
||||
g.db.add(v)
|
||||
|
||||
parent_post.comment_count = g.db.query(Comment).filter_by(parent_submission=parent_post.id).count()
|
||||
g.db.add(parent_post)
|
||||
g.db.flush()
|
||||
|
||||
if request.headers.get("Authorization"): return c.json
|
||||
else: return jsonify({"html": render_template("comments.html",
|
||||
|
|
|
@ -884,6 +884,9 @@ def submit_post(v):
|
|||
g.db.add(c)
|
||||
g.db.flush()
|
||||
|
||||
new_post.comment_count = g.db.query(Comment).filter_by(parent_submission=new_post.id).count()
|
||||
g.db.add(new_post)
|
||||
|
||||
if "rdrama" in request.host:
|
||||
if v.id == 995: body = "fuck off carp"
|
||||
else: body = random.choice(snappyquotes)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue