dffsd
This commit is contained in:
parent
5e8a522310
commit
310c40e524
3 changed files with 6 additions and 2 deletions
|
@ -40,7 +40,7 @@ class Comment(Base):
|
||||||
notifiedto=Column(Integer)
|
notifiedto=Column(Integer)
|
||||||
app_id = Column(Integer, ForeignKey("oauth_apps.id"))
|
app_id = Column(Integer, ForeignKey("oauth_apps.id"))
|
||||||
oauth_app = relationship("OauthApp", viewonly=True)
|
oauth_app = relationship("OauthApp", viewonly=True)
|
||||||
upvotes = Column(Integer, default=0)
|
upvotes = Column(Integer, default=1)
|
||||||
downvotes = Column(Integer, default=0)
|
downvotes = Column(Integer, default=0)
|
||||||
body = deferred(Column(String))
|
body = deferred(Column(String))
|
||||||
body_html = deferred(Column(String))
|
body_html = deferred(Column(String))
|
||||||
|
|
|
@ -280,7 +280,8 @@ def api_comment(v):
|
||||||
parent_submission=parent_submission,
|
parent_submission=parent_submission,
|
||||||
parent_comment_id=c.id,
|
parent_comment_id=c.id,
|
||||||
level=level+1,
|
level=level+1,
|
||||||
body_html=filter_title(option)
|
body_html=filter_title(option),
|
||||||
|
upvotes=0
|
||||||
)
|
)
|
||||||
|
|
||||||
g.db.add(c_option)
|
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 = g.db.query(User).options(lazyload('*')).filter_by(id = LONGPOSTBOT_ACCOUNT).first()
|
||||||
longpostbot.comment_count += 1
|
longpostbot.comment_count += 1
|
||||||
|
longpostbot.coins += 1
|
||||||
g.db.add(longpostbot)
|
g.db.add(longpostbot)
|
||||||
|
|
||||||
g.db.flush()
|
g.db.flush()
|
||||||
|
|
|
@ -711,6 +711,7 @@ def submit_post(v):
|
||||||
parent_submission=new_post.id,
|
parent_submission=new_post.id,
|
||||||
level=1,
|
level=1,
|
||||||
body_html=filter_title(option),
|
body_html=filter_title(option),
|
||||||
|
upvotes=0
|
||||||
)
|
)
|
||||||
|
|
||||||
g.db.add(c)
|
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 = g.db.query(User).options(lazyload('*')).filter_by(id = SNAPPY_ACCOUNT).first()
|
||||||
snappy.comment_count += 1
|
snappy.comment_count += 1
|
||||||
|
snappy.coins += 1
|
||||||
g.db.add(snappy)
|
g.db.add(snappy)
|
||||||
|
|
||||||
g.db.flush()
|
g.db.flush()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue