sfd
parent
5fddfae64c
commit
7ddd5ec76a
|
@ -700,31 +700,29 @@ def edit_comment(cid, v):
|
|||
if v.agendaposter and not v.marseyawarded:
|
||||
body = torture_ap(body, v.username)
|
||||
|
||||
if not c.options:
|
||||
for i in poll_regex.finditer(body):
|
||||
body = body.replace(i.group(0), "")
|
||||
c_option = Comment(author_id=AUTOPOLLER_ID,
|
||||
parent_submission=c.parent_submission,
|
||||
parent_comment_id=c.id,
|
||||
level=c.level+1,
|
||||
body_html=filter_emojis_only(i.group(1)),
|
||||
upvotes=0,
|
||||
is_bot=True
|
||||
)
|
||||
g.db.add(c_option)
|
||||
for i in poll_regex.finditer(body):
|
||||
body = body.replace(i.group(0), "")
|
||||
c_option = Comment(author_id=AUTOPOLLER_ID,
|
||||
parent_submission=c.parent_submission,
|
||||
parent_comment_id=c.id,
|
||||
level=c.level+1,
|
||||
body_html=filter_emojis_only(i.group(1)),
|
||||
upvotes=0,
|
||||
is_bot=True
|
||||
)
|
||||
g.db.add(c_option)
|
||||
|
||||
if not c.choices:
|
||||
for i in choice_regex.finditer(body):
|
||||
body = body.replace(i.group(0), "")
|
||||
c_choice = Comment(author_id=AUTOCHOICE_ID,
|
||||
parent_submission=c.parent_submission,
|
||||
parent_comment_id=c.id,
|
||||
level=c.level+1,
|
||||
body_html=filter_emojis_only(i.group(1)),
|
||||
upvotes=0,
|
||||
is_bot=True
|
||||
)
|
||||
g.db.add(c_choice)
|
||||
for i in choice_regex.finditer(body):
|
||||
body = body.replace(i.group(0), "")
|
||||
c_choice = Comment(author_id=AUTOCHOICE_ID,
|
||||
parent_submission=c.parent_submission,
|
||||
parent_comment_id=c.id,
|
||||
level=c.level+1,
|
||||
body_html=filter_emojis_only(i.group(1)),
|
||||
upvotes=0,
|
||||
is_bot=True
|
||||
)
|
||||
g.db.add(c_choice)
|
||||
|
||||
body_html = sanitize(body, edit=True)
|
||||
|
||||
|
|
|
@ -476,29 +476,27 @@ def edit_post(pid, v):
|
|||
if body != p.body:
|
||||
if v.id == p.author_id and v.agendaposter and not v.marseyawarded: body = torture_ap(body, v.username)
|
||||
|
||||
if not p.options:
|
||||
for i in poll_regex.finditer(body):
|
||||
body = body.replace(i.group(0), "")
|
||||
c = Comment(author_id=AUTOPOLLER_ID,
|
||||
parent_submission=p.id,
|
||||
level=1,
|
||||
body_html=filter_emojis_only(i.group(1)),
|
||||
upvotes=0,
|
||||
is_bot=True
|
||||
)
|
||||
g.db.add(c)
|
||||
for i in poll_regex.finditer(body):
|
||||
body = body.replace(i.group(0), "")
|
||||
c = Comment(author_id=AUTOPOLLER_ID,
|
||||
parent_submission=p.id,
|
||||
level=1,
|
||||
body_html=filter_emojis_only(i.group(1)),
|
||||
upvotes=0,
|
||||
is_bot=True
|
||||
)
|
||||
g.db.add(c)
|
||||
|
||||
if not p.choices:
|
||||
for i in choice_regex.finditer(body):
|
||||
body = body.replace(i.group(0), "")
|
||||
c = Comment(author_id=AUTOCHOICE_ID,
|
||||
parent_submission=p.id,
|
||||
level=1,
|
||||
body_html=filter_emojis_only(i.group(1)),
|
||||
upvotes=0,
|
||||
is_bot=True
|
||||
)
|
||||
g.db.add(c)
|
||||
for i in choice_regex.finditer(body):
|
||||
body = body.replace(i.group(0), "")
|
||||
c = Comment(author_id=AUTOCHOICE_ID,
|
||||
parent_submission=p.id,
|
||||
level=1,
|
||||
body_html=filter_emojis_only(i.group(1)),
|
||||
upvotes=0,
|
||||
is_bot=True
|
||||
)
|
||||
g.db.add(c)
|
||||
|
||||
body_html = sanitize(body, edit=True)
|
||||
|
||||
|
|
Loading…
Reference in New Issue