From 299bda3b8af474ee4f18031901856590a32086aa Mon Sep 17 00:00:00 2001 From: Aevann Date: Wed, 2 Aug 2023 11:27:03 +0300 Subject: [PATCH] """""fix"""""" ping groups in /submit --- files/helpers/alerts.py | 3 ++- files/routes/posts.py | 5 ----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/files/helpers/alerts.py b/files/helpers/alerts.py index 66dd04f5a..c8bfeb0ac 100644 --- a/files/helpers/alerts.py +++ b/files/helpers/alerts.py @@ -116,7 +116,8 @@ def add_notif(cid, uid, text, pushnotif_url=''): if ' has mentioned you: [' in text: text = text.split(':')[0] + '!' - push_notif({uid}, 'New notification', text, pushnotif_url) + if not request.path.startswith('/submit'): + push_notif({uid}, 'New notification', text, pushnotif_url) def NOTIFY_USERS(text, v, oldtext=None, ghost=False, log_cost=None): diff --git a/files/routes/posts.py b/files/routes/posts.py index f88085d4e..7aca89372 100644 --- a/files/routes/posts.py +++ b/files/routes/posts.py @@ -449,11 +449,6 @@ def submit_post(v, sub=None): body = request.values.get("body", "") body = body[:POST_BODY_LENGTH_LIMIT(g.v)].strip() - post_ping_group_count = len(list(group_mention_regex.finditer(body))) - - if post_ping_group_count: - abort(400, "Ping group usage is temporarily disabled on creating posts due to performance issues (will fix in a bit), for now make the post without ping groups then edit it and add the ping groups") - if not title: abort(400, "Please enter a better title!")