forked from rDrama/rDrama
sdfdsf
parent
37df12d3b6
commit
7fb808eb9a
|
@ -303,7 +303,6 @@ def api_comment(v):
|
||||||
level=level+1,
|
level=level+1,
|
||||||
is_bot=True,
|
is_bot=True,
|
||||||
body_html=body_based_html,
|
body_html=body_based_html,
|
||||||
body=body2
|
|
||||||
)
|
)
|
||||||
|
|
||||||
g.db.add(c_based)
|
g.db.add(c_based)
|
||||||
|
@ -335,7 +334,6 @@ def api_comment(v):
|
||||||
level=level+1,
|
level=level+1,
|
||||||
is_bot=True,
|
is_bot=True,
|
||||||
body_html=body_jannied_html,
|
body_html=body_jannied_html,
|
||||||
body=body2
|
|
||||||
)
|
)
|
||||||
|
|
||||||
g.db.add(c_jannied)
|
g.db.add(c_jannied)
|
||||||
|
@ -369,7 +367,6 @@ def api_comment(v):
|
||||||
level=level+1,
|
level=level+1,
|
||||||
is_bot=True,
|
is_bot=True,
|
||||||
body_html=body_jannied_html,
|
body_html=body_jannied_html,
|
||||||
body=body
|
|
||||||
)
|
)
|
||||||
|
|
||||||
g.db.add(c_jannied)
|
g.db.add(c_jannied)
|
||||||
|
@ -404,7 +401,6 @@ def api_comment(v):
|
||||||
level=level+1,
|
level=level+1,
|
||||||
is_bot=True,
|
is_bot=True,
|
||||||
body_html=body_html2,
|
body_html=body_html2,
|
||||||
body=body
|
|
||||||
)
|
)
|
||||||
|
|
||||||
g.db.add(c2)
|
g.db.add(c2)
|
||||||
|
@ -442,7 +438,6 @@ def api_comment(v):
|
||||||
level=level+1,
|
level=level+1,
|
||||||
is_bot=True,
|
is_bot=True,
|
||||||
body_html=body_html2,
|
body_html=body_html2,
|
||||||
body=body
|
|
||||||
)
|
)
|
||||||
|
|
||||||
g.db.add(c2)
|
g.db.add(c2)
|
||||||
|
@ -469,7 +464,6 @@ def api_comment(v):
|
||||||
level=level+2,
|
level=level+2,
|
||||||
is_bot=True,
|
is_bot=True,
|
||||||
body_html=body_html2,
|
body_html=body_html2,
|
||||||
body=body,
|
|
||||||
)
|
)
|
||||||
|
|
||||||
g.db.add(c3)
|
g.db.add(c3)
|
||||||
|
@ -492,7 +486,6 @@ def api_comment(v):
|
||||||
level=level+3,
|
level=level+3,
|
||||||
is_bot=True,
|
is_bot=True,
|
||||||
body_html=body_html2,
|
body_html=body_html2,
|
||||||
body=body
|
|
||||||
)
|
)
|
||||||
|
|
||||||
g.db.add(c4)
|
g.db.add(c4)
|
||||||
|
@ -709,7 +702,6 @@ def edit_comment(cid, v):
|
||||||
level=c.level+1,
|
level=c.level+1,
|
||||||
is_bot=True,
|
is_bot=True,
|
||||||
body_html=body_jannied_html,
|
body_html=body_jannied_html,
|
||||||
body=body
|
|
||||||
)
|
)
|
||||||
|
|
||||||
g.db.add(c_jannied)
|
g.db.add(c_jannied)
|
||||||
|
@ -744,7 +736,6 @@ def edit_comment(cid, v):
|
||||||
level=c.level+1,
|
level=c.level+1,
|
||||||
is_bot=True,
|
is_bot=True,
|
||||||
body_html=body_jannied_html,
|
body_html=body_jannied_html,
|
||||||
body=body,
|
|
||||||
)
|
)
|
||||||
|
|
||||||
g.db.add(c_jannied)
|
g.db.add(c_jannied)
|
||||||
|
|
|
@ -280,7 +280,6 @@ def edit_post(pid, v):
|
||||||
is_pinned=True,
|
is_pinned=True,
|
||||||
distinguish_level=6,
|
distinguish_level=6,
|
||||||
body_html=body_jannied_html,
|
body_html=body_jannied_html,
|
||||||
body=body
|
|
||||||
)
|
)
|
||||||
|
|
||||||
g.db.add(c_jannied)
|
g.db.add(c_jannied)
|
||||||
|
@ -313,7 +312,6 @@ def edit_post(pid, v):
|
||||||
is_pinned=True,
|
is_pinned=True,
|
||||||
distinguish_level=6,
|
distinguish_level=6,
|
||||||
body_html=body_jannied_html,
|
body_html=body_jannied_html,
|
||||||
body=body
|
|
||||||
)
|
)
|
||||||
|
|
||||||
g.db.add(c_jannied)
|
g.db.add(c_jannied)
|
||||||
|
@ -823,7 +821,6 @@ def submit_post(v):
|
||||||
is_pinned=True,
|
is_pinned=True,
|
||||||
distinguish_level=6,
|
distinguish_level=6,
|
||||||
body_html=body_jannied_html,
|
body_html=body_jannied_html,
|
||||||
body=body,
|
|
||||||
)
|
)
|
||||||
|
|
||||||
g.db.add(c_jannied)
|
g.db.add(c_jannied)
|
||||||
|
@ -858,7 +855,6 @@ def submit_post(v):
|
||||||
is_pinned=True,
|
is_pinned=True,
|
||||||
distinguish_level=6,
|
distinguish_level=6,
|
||||||
body_html=body_jannied_html,
|
body_html=body_jannied_html,
|
||||||
body=body,
|
|
||||||
)
|
)
|
||||||
|
|
||||||
g.db.add(c_jannied)
|
g.db.add(c_jannied)
|
||||||
|
@ -910,30 +906,30 @@ def submit_post(v):
|
||||||
body_md = CustomRenderer().render(mistletoe.Document(body))
|
body_md = CustomRenderer().render(mistletoe.Document(body))
|
||||||
body_html = sanitize(body_md)
|
body_html = sanitize(body_md)
|
||||||
|
|
||||||
c = Comment(author_id=SNAPPY_ACCOUNT,
|
if len(body_html) < 20000
|
||||||
distinguish_level=6,
|
c = Comment(author_id=SNAPPY_ACCOUNT,
|
||||||
parent_submission=new_post.id,
|
distinguish_level=6,
|
||||||
level=1,
|
parent_submission=new_post.id,
|
||||||
over_18=False,
|
level=1,
|
||||||
is_bot=request.host!='pcmemes.net',
|
over_18=False,
|
||||||
app_id=None,
|
is_bot=request.host!='pcmemes.net',
|
||||||
body_html=body_html,
|
app_id=None,
|
||||||
body=body,
|
body_html=body_html,
|
||||||
)
|
)
|
||||||
|
|
||||||
g.db.add(c)
|
g.db.add(c)
|
||||||
|
|
||||||
snappy = g.db.query(User).filter_by(id = SNAPPY_ACCOUNT).first()
|
snappy = g.db.query(User).filter_by(id = SNAPPY_ACCOUNT).first()
|
||||||
snappy.comment_count += 1
|
snappy.comment_count += 1
|
||||||
snappy.coins += 1
|
snappy.coins += 1
|
||||||
g.db.add(snappy)
|
g.db.add(snappy)
|
||||||
|
|
||||||
g.db.flush()
|
g.db.flush()
|
||||||
|
|
||||||
|
|
||||||
n = Notification(comment_id=c.id, user_id=v.id)
|
n = Notification(comment_id=c.id, user_id=v.id)
|
||||||
g.db.add(n)
|
g.db.add(n)
|
||||||
g.db.flush()
|
g.db.flush()
|
||||||
|
|
||||||
v.post_count = g.db.query(Submission.id).filter_by(author_id=v.id, is_banned=False, deleted_utc=0).count()
|
v.post_count = g.db.query(Submission.id).filter_by(author_id=v.id, is_banned=False, deleted_utc=0).count()
|
||||||
g.db.add(v)
|
g.db.add(v)
|
||||||
|
|
Loading…
Reference in New Issue