diff --git a/notifications_routing/router.py b/notifications_routing/router.py index d70bf9befefeed547d76bac4085486957e3a7f21..d4d28482ef9b01e4f4b4c5e928ac9390b3d196d8 100644 --- a/notifications_routing/router.py +++ b/notifications_routing/router.py @@ -85,11 +85,12 @@ class Router(megabus.Listener): ): """Add users from groups to users list.""" unique_usernames = [channel_user[self.data_source.USERNAME] for channel_user in users] - logging.debug("channel %s usernames: %s", channel_id, unique_usernames) + logging.debug("notification %s channel usernames: %s", notification_id, unique_usernames) for group_id in groups: group_users = self.data_source.get_group_users(group_id) - logging.debug("channel %s groups %s", channel_id, group_users) + audit_notification(notification_id, {"event": "get_group_users", "group": group_id, "users": group_users}) + logging.debug("channel %s groups users %s", channel_id, group_users) for user in group_users: if user[self.data_source.USERNAME] in unique_usernames: @@ -106,7 +107,7 @@ class Router(megabus.Listener): users.append(user) unique_usernames.append(user[self.data_source.USERNAME]) - logging.debug("channel %s final users %s", channel_id, users) + logging.debug("notification %s final users %s", notification_id, users) def get_channel_users(self, notification_id, channel_id): """Join users from our data source and the grappa system to return a unique users list."""