From ad8cb16bee33281e3246ea171dc81584527e9f39 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Thu, 11 Aug 2022 15:25:56 +0200 Subject: [PATCH] notify chadmins of new holes --- files/routes/subs.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/files/routes/subs.py b/files/routes/subs.py index 6c1c0abb6..0a233cf5b 100644 --- a/files/routes/subs.py +++ b/files/routes/subs.py @@ -295,6 +295,10 @@ def create_sub2(v): mod = Mod(user_id=v.id, sub=sub.name) g.db.add(mod) + admins = [x[0] for x in g.db.query(User.id).filter(User.admin_level > 1, User.id != v.id).all()] + for admin in admins: + send_repeatable_notification(admin, f":!marseyparty: /h/{sub.name} has been created by @{v.username} :marseyparty:") + return redirect(f'/h/{sub.name}') @app.post("/kick/")