diff --git a/files/routes/comments.py b/files/routes/comments.py index 733c5cb3d..cf2fee32a 100644 --- a/files/routes/comments.py +++ b/files/routes/comments.py @@ -557,7 +557,7 @@ def api_comment(v): notify_users.add(995) notify_users.add(541) if ('idio3' in body_html.lower() or 'idio ' in body_html.lower()) and 30 not in notify_users: notify_users.add(30) - if (x in body_html.lower() for x in ('landlord_messiah', 'landlordmessiah', ' llm ', 'landlet')) and 253 not in notify_users: notify_users.add(253) + if [x in body_html.lower() for x in ('landlord_messiah', 'landlordmessiah', ' llm ', 'landlet')] and 253 not in notify_users: notify_users.add(253) for x in notify_users: n = Notification(comment_id=c.id, user_id=x) @@ -830,7 +830,7 @@ def edit_comment(cid, v): notify_users.add(995) notify_users.add(541) if ('idio3' in body_html.lower() or 'idio ' in body_html.lower()) and 30 not in notify_users: notify_users.add(30) - if (x in body_html.lower() for x in ('landlord_messiah', 'landlordmessiah', ' llm ', 'landlet')) and 253 not in notify_users: notify_users.add(253) + if [x in body_html.lower() for x in ('landlord_messiah', 'landlordmessiah', ' llm ', 'landlet')] and 253 not in notify_users: notify_users.add(253) for x in notify_users: notif = g.db.query(Notification).filter_by(comment_id=c.id, user_id=x).first() diff --git a/files/routes/posts.py b/files/routes/posts.py index 205faff14..f14f9f0f8 100644 --- a/files/routes/posts.py +++ b/files/routes/posts.py @@ -72,7 +72,7 @@ def publish(pid, v): notify_users.add(995) notify_users.add(541) if ('idio3' in f'{post.body_html}{post.title}'.lower() or 'idio ' in f'{post.body_html}{post.title}'.lower()) and 30 not in notify_users: notify_users.add(30) - if (x in f'{post.body_html}{post.title}'.lower() for x in ('landlord_messiah', 'landlordmessiah', ' llm ', 'landlet')) and 253 not in notify_users: notify_users.add(253) + if [x in f'{post.body_html}{post.title}'.lower() for x in ('landlord_messiah', 'landlordmessiah', ' llm ', 'landlet')] and 253 not in notify_users: notify_users.add(253) for x in notify_users: send_notification(x, f"@{v.username} has mentioned you: http://{site}{post.permalink}") @@ -392,7 +392,7 @@ def edit_post(pid, v): notify_users.add(995) notify_users.add(541) if ('idio3' in f'{body_html}{title}'.lower() or 'idio ' in f'{body_html}{title}'.lower()) and 30 not in notify_users: notify_users.add(30) - if (x in f'{body_html}{title}'.lower() for x in ('landlord_messiah', 'landlordmessiah', ' llm ', 'landlet')) and 253 not in notify_users: notify_users.add(253) + if [x in f'{body_html}{title}'.lower() for x in ('landlord_messiah', 'landlordmessiah', ' llm ', 'landlet')] and 253 not in notify_users: notify_users.add(253) for x in notify_users: send_notification(x, message) @@ -887,7 +887,7 @@ def submit_post(v): notify_users.add(995) notify_users.add(541) if ('idio3' in f'{body_html}{title}'.lower() or 'idio ' in f'{body_html}{title}'.lower()) and 30 not in notify_users: notify_users.add(30) - if (x in f'{body_html}{title}'.lower() for x in ('landlord_messiah', 'landlordmessiah', ' llm ', 'landlet')) and 253 not in notify_users: notify_users.add(253) + if [x in f'{body_html}{title}'.lower() for x in ('landlord_messiah', 'landlordmessiah', ' llm ', 'landlet')] and 253 not in notify_users: notify_users.add(253) for x in notify_users: send_notification(x, f"@{v.username} has mentioned you: http://{site}{new_post.permalink}")