remotes/1693045480750635534/spooky-22
Aevann1 2021-10-29 18:22:51 +02:00
parent 678972d2e0
commit 00d767d704
3 changed files with 6 additions and 2 deletions

View File

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

View File

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

View File

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