From 097af92efda8aa1ed4a46db8c4b1532e501e4ad5 Mon Sep 17 00:00:00 2001 From: Aevann Date: Mon, 12 Feb 2024 15:12:42 +0200 Subject: [PATCH] do this https://rdrama.net/post/18459/marseycapywalking-megathread-for-bugs-and-suggestions/5458574#context --- files/routes/groups.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/files/routes/groups.py b/files/routes/groups.py index 907e2fc09..9aecfef4c 100644 --- a/files/routes/groups.py +++ b/files/routes/groups.py @@ -90,7 +90,13 @@ def join_group(v, group_name): if not existing: join = GroupMembership(user_id=v.id, group_name=group_name) g.db.add(join) - send_notification(group.owner_id, f"@{v.username} has applied to join !{group}. You can approve or reject the application [here](/!{group}).") + + notified_ids = [group.owner_id] + notified_ids += [x[0] for x in g.db.query(GroupMembership.user_id).filter_by(group_name=group_name, is_mod=True).all()] + notified_ids = list(set(notified_ids)) + + for uid in notified_ids: + send_notification(uid, f"@{v.username} has applied to join !{group}. You can approve or reject the application [here](/!{group}).") return {"message": f"Application submitted to !{group}'s owner (@{group.owner.username}) successfully!"}