From a1b80e37432f6b310f7ef8899ec3db1b3c1c6384 Mon Sep 17 00:00:00 2001 From: Aevann Date: Sat, 17 Feb 2024 16:00:59 +0200 Subject: [PATCH] remove alert_admins --- files/helpers/alerts.py | 16 ---------------- files/routes/oauth.py | 2 +- files/routes/posts.py | 2 +- 3 files changed, 2 insertions(+), 18 deletions(-) diff --git a/files/helpers/alerts.py b/files/helpers/alerts.py index d12d0211a..f0a299cf8 100644 --- a/files/helpers/alerts.py +++ b/files/helpers/alerts.py @@ -302,22 +302,6 @@ def alert_everyone(cid): on conflict do nothing;""") g.db.execute(_everyone_query) -def alert_admins(body): - body_html = sanitize(body, blackjack="admin alert") - - new_comment = Comment(author_id=AUTOJANNY_ID, - parent_post=None, - level=1, - body_html=body_html, - sentto=MODMAIL_ID, - distinguished=True, - is_bot=True - ) - g.db.add(new_comment) - g.db.flush() - - new_comment.top_comment_id = new_comment.id - def alert_active_users(body, vid, extra_criteria): body_html = sanitize(body, blackjack="notification") cid = create_comment(body_html) diff --git a/files/routes/oauth.py b/files/routes/oauth.py index d559598a5..2ef87687c 100644 --- a/files/routes/oauth.py +++ b/files/routes/oauth.py @@ -71,7 +71,7 @@ def request_api_keys(v): g.db.add(new_app) body = f"@{v.username} has requested API keys for `{request.values.get('name')}`. You can approve or deny the request [here](/admin/apps)." - alert_admins(body) + send_repeatable_notification(AEVANN_ID, body) return {"message": "API keys requested successfully!"} diff --git a/files/routes/posts.py b/files/routes/posts.py index c66d88aed..d3fd65b85 100644 --- a/files/routes/posts.py +++ b/files/routes/posts.py @@ -723,7 +723,7 @@ def submit_post(v, hole=None): if flag_effortpost and not (SITE_NAME == 'WPD' and v.truescore < 500): body = f"@{v.username} has requested that [{p.title}](/post/{p.id}) be marked as an effortpost!" - alert_admins(body) + send_repeatable_notification(AEVANN_ID, body) if v.client: return p.json else: