diff --git a/files/helpers/config/const.py b/files/helpers/config/const.py index 0cb388ef4..de3be3bd2 100644 --- a/files/helpers/config/const.py +++ b/files/helpers/config/const.py @@ -176,6 +176,7 @@ PERMS = { # Minimum admin_level to perform action. 'ENABLE_VOTE_BUTTONS_ON_USER_PAGE': 1, 'NOTIFICATIONS_HOLE_INACTIVITY_DELETION': 1, 'NOTIFICATIONS_HOLE_CREATION': 1, + 'NOTIFICATIONS_GROUP_CREATION': 1, 'NOTIFICATIONS_MODERATOR_ACTIONS': 1, 'IS_PERMA_PROGSTACKED': 2, diff --git a/files/routes/groups.py b/files/routes/groups.py index 3f9dab114..24bb8b2da 100644 --- a/files/routes/groups.py +++ b/files/routes/groups.py @@ -54,14 +54,9 @@ def create_group(v): g.db.flush() #Necessary, to make linkfying the ping group in the notification work - text = f":!marseyparty: !{group} has been created by @{v.username} :marseyparty:" - text_html = sanitize(text, blackjack="notification") - cid = create_comment(text_html) - t = time.time() - 604800 - excluded_ids = (v.id, 556, 868, 6289, 21238) - notified_users = [x[0] for x in g.db.query(User.id).filter(User.admin_level >= PERMS['NOTIFICATIONS_HOLE_CREATION'], User.last_active > t, User.id.notin_(excluded_ids))] - for uid in notified_users: - add_notif(cid, uid, text, check_existing=False) + admins = [x[0] for x in g.db.query(User.id).filter(User.admin_level >= PERMS['NOTIFICATIONS_GROUP_CREATION'], User.id != v.id)] + for admin in admins: + send_repeatable_notification(admin, f":!marseyparty: !{group} has been created by @{v.username} :marseyparty:") return {"message": f"!{group} created successfully!"}