diff --git a/files/classes/comment.py b/files/classes/comment.py index 1a595bfbf..fc3f04238 100644 --- a/files/classes/comment.py +++ b/files/classes/comment.py @@ -40,7 +40,7 @@ class Comment(Base): notifiedto=Column(Integer) app_id = Column(Integer, ForeignKey("oauth_apps.id")) oauth_app = relationship("OauthApp", viewonly=True) - upvotes = Column(Integer, default=0) + upvotes = Column(Integer, default=1) downvotes = Column(Integer, default=0) body = deferred(Column(String)) body_html = deferred(Column(String)) diff --git a/files/routes/comments.py b/files/routes/comments.py index 0076dccc9..f59f991a7 100755 --- a/files/routes/comments.py +++ b/files/routes/comments.py @@ -280,7 +280,8 @@ def api_comment(v): parent_submission=parent_submission, parent_comment_id=c.id, level=level+1, - body_html=filter_title(option) + body_html=filter_title(option), + upvotes=0 ) g.db.add(c_option) @@ -417,6 +418,7 @@ def api_comment(v): longpostbot = g.db.query(User).options(lazyload('*')).filter_by(id = LONGPOSTBOT_ACCOUNT).first() longpostbot.comment_count += 1 + longpostbot.coins += 1 g.db.add(longpostbot) g.db.flush() diff --git a/files/routes/posts.py b/files/routes/posts.py index de3362d2a..1f3cfdcdb 100755 --- a/files/routes/posts.py +++ b/files/routes/posts.py @@ -711,6 +711,7 @@ def submit_post(v): parent_submission=new_post.id, level=1, body_html=filter_title(option), + upvotes=0 ) g.db.add(c) @@ -906,6 +907,7 @@ def submit_post(v): snappy = g.db.query(User).options(lazyload('*')).filter_by(id = SNAPPY_ACCOUNT).first() snappy.comment_count += 1 + snappy.coins += 1 g.db.add(snappy) g.db.flush()