From bb3c120e8c30817b15e714e4d70401148f76db8b Mon Sep 17 00:00:00 2001 From: Aevann Date: Fri, 23 Jun 2023 20:47:08 +0300 Subject: [PATCH] fix wrong autojanny comment count --- files/routes/comments.py | 5 ++++- files/routes/posts.py | 4 ++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/files/routes/comments.py b/files/routes/comments.py index ef5d90c8d..0f0acd2b2 100644 --- a/files/routes/comments.py +++ b/files/routes/comments.py @@ -320,10 +320,13 @@ def comment(v:User): post_target.comment_count += 1 g.db.add(post_target) - n = Notification(comment_id=c_jannied.id, user_id=v.id) g.db.add(n) + autojanny = g.db.get(User, AUTOJANNY_ID) + autojanny.comment_count += 1 + g.db.add(autojanny) + execute_longpostbot(c, level, body, body_html, post_target, v) execute_zozbot(c, level, post_target, v) diff --git a/files/routes/posts.py b/files/routes/posts.py index 6e3e9bc94..846be7e3d 100644 --- a/files/routes/posts.py +++ b/files/routes/posts.py @@ -706,6 +706,10 @@ def submit_post(v:User, sub=None): n = Notification(comment_id=c_jannied.id, user_id=v.id) g.db.add(n) + autojanny = g.db.get(User, AUTOJANNY_ID) + autojanny.comment_count += 1 + g.db.add(autojanny) + if not p.private and not (p.sub and g.db.query(Exile.user_id).filter_by(user_id=SNAPPY_ID, sub=p.sub).one_or_none()): execute_snappy(p, v)