Skip multiple autojanny comment error (#204)
Error happens here where multiple autojanny comments are found on a new install, should probably be handled by deleting one of them 🤷. This at least allows new installs to work without some database tinkering Co-authored-by: Chuck <dude@bussy.com> Reviewed-on: #204 Co-authored-by: top <top@noreply.fsdfsd.net> Co-committed-by: top <top@noreply.fsdfsd.net>pull/208/head
parent
24eafc85d8
commit
aa9bbe06cd
|
@ -84,11 +84,16 @@ def notify_mentions(mentions, send_to=None, mention_str='site mention'):
|
||||||
)
|
)
|
||||||
|
|
||||||
g.db.flush()
|
g.db.flush()
|
||||||
existing_comment = g.db.query(Comment.id).filter_by(
|
try:
|
||||||
author_id=const.AUTOJANNY_ID,
|
existing_comment = g.db.query(Comment.id).filter_by(
|
||||||
parent_post=None,
|
author_id=const.AUTOJANNY_ID,
|
||||||
body_html=notif_text).one_or_none()
|
parent_post=None,
|
||||||
if existing_comment: break
|
body_html=notif_text).one_or_none()
|
||||||
|
if existing_comment: break
|
||||||
|
# todo: handle this exception by removing one of the existing
|
||||||
|
# means that multiple rows were found, happens on new install for some reason
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
|
||||||
new_comment = Comment(
|
new_comment = Comment(
|
||||||
author_id=const.AUTOJANNY_ID,
|
author_id=const.AUTOJANNY_ID,
|
||||||
|
|
Loading…
Reference in New Issue