transfers fix

This commit is contained in:
Aevann1 2022-03-04 18:53:28 +02:00
parent 1e3f1a1962
commit 5faab645c2
4 changed files with 10 additions and 11 deletions

View file

@ -9,7 +9,6 @@ def create_comment(text_html, autojanny=False):
new_comment = Comment(author_id=author_id,
parent_submission=None,
created_utc=0,
body_html=text_html)
g.db.add(new_comment)
g.db.flush()
@ -22,7 +21,7 @@ def send_repeatable_notification(uid, text, autojanny=False):
text_html = sanitize(text)
existing_comment = g.db.query(Comment.id).filter_by(author_id=author_id, parent_submission=None, body_html=text_html, created_utc=0).first()
existing_comment = g.db.query(Comment.id).filter_by(author_id=author_id, parent_submission=None, body_html=text_html).first()
if existing_comment:
cid = existing_comment[0]
@ -47,7 +46,7 @@ def notif_comment(text, autojanny=False):
text_html = sanitize(text, alert=True)
existing = g.db.query(Comment.id).filter_by(author_id=author_id, parent_submission=None, body_html=text_html, created_utc=0).one_or_none()
existing = g.db.query(Comment.id).filter_by(author_id=author_id, parent_submission=None, body_html=text_html).one_or_none()
if existing: return existing[0]
else: return create_comment(text_html, autojanny)