fix wrong autojanny comment count

pull/157/head
Aevann 2023-06-23 20:47:08 +03:00
parent e3e7c4a8b6
commit bb3c120e8c
2 changed files with 8 additions and 1 deletions

View File

@ -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)

View File

@ -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)