diff --git a/files/routes/comments.py b/files/routes/comments.py index ce57540e5a..84d6145422 100755 --- a/files/routes/comments.py +++ b/files/routes/comments.py @@ -523,7 +523,7 @@ def api_comment(v): notify_users.add(user.id) if request.host == 'rdrama.net' and 'aevann' in body_html.lower() and 1 not in notify_users: - notify_users.append(1) + notify_users.add(1) for x in notify_users: n = Notification(comment_id=c.id, user_id=x) @@ -758,7 +758,7 @@ def edit_comment(cid, v): if user.id != v.id: notify_users.add(user.id) - if request.host == 'rdrama.net' and 'aevann' in body_html.lower() and 1 not in notify_users: notify_users.append(1) + if request.host == 'rdrama.net' and 'aevann' in body_html.lower() and 1 not in notify_users: notify_users.add(1) for x in notify_users: notif = notifs.filter_by(comment_id=c.id, user_id=x).first() diff --git a/files/routes/posts.py b/files/routes/posts.py index 3c610009a1..a1523d1f82 100755 --- a/files/routes/posts.py +++ b/files/routes/posts.py @@ -66,7 +66,7 @@ def publish(pid, v): user = g.db.query(User).options(lazyload('*')).filter_by(username=username).first() if user and not v.any_block_exists(user) and user.id != v.id: notify_users.add(user) - if request.host == 'rdrama.net' and 'aevann' in post.body_html.lower() and 1 not in notify_users: notify_users.append(1) + if request.host == 'rdrama.net' and 'aevann' in post.body_html.lower() and 1 not in notify_users: notify_users.add(1) for x in notify_users: send_notification(x.id, f"@{v.username} has mentioned you: http://{site}{new_post.permalink}") @@ -319,7 +319,7 @@ def edit_post(pid, v): message = f"@{v.username} has mentioned you: http://{site}{p.permalink}" - if request.host == 'rdrama.net' and 'aevann' in body_html.lower() and 1 not in notify_users: notify_users.append(1) + if request.host == 'rdrama.net' and 'aevann' in body_html.lower() and 1 not in notify_users: notify_users.add(1) for x in notify_users: existing = g.db.query(Comment).options(lazyload('*')).filter(Comment.author_id == NOTIFICATIONS_ACCOUNT, Comment.body == message, Comment.notifiedto == x.id).first() @@ -763,7 +763,7 @@ def submit_post(v): user = g.db.query(User).options(lazyload('*')).filter_by(username=username).first() if user and not v.any_block_exists(user) and user.id != v.id: notify_users.add(user) - if request.host == 'rdrama.net' and 'aevann' in body_html.lower() and 1 not in notify_users: notify_users.append(1) + if request.host == 'rdrama.net' and 'aevann' in body_html.lower() and 1 not in notify_users: notify_users.add(1) for x in notify_users: send_notification(x.id, f"@{v.username} has mentioned you: http://{site}{new_post.permalink}")