diff --git a/notifications.py b/notifications.py index bd3e9e7..b0380ac 100644 --- a/notifications.py +++ b/notifications.py @@ -98,9 +98,9 @@ async def check_and_notify_threshold(agent_name: str): if recent: return - # Get admin user emails + # Get admin user emails (exclude placeholder accounts with no real domain) admin_cursor = users_collection.find( - {"is_admin": True, "is_active": True}, + {"is_admin": True, "is_active": True, "email": {"$not": {"$regex": r"@agenthub\.com$"}}}, {"email": 1}, ) admin_emails = [doc["email"] async for doc in admin_cursor] @@ -264,9 +264,9 @@ async def send_weekly_agent_digest(): except Exception: agent["created_by_email"] = created_by - # Get admin emails + # Get admin emails (exclude placeholder accounts with no real domain) admin_cursor = users_collection.find( - {"is_admin": True, "is_active": True}, + {"is_admin": True, "is_active": True, "email": {"$not": {"$regex": r"@agenthub\.com$"}}}, {"email": 1}, ) admin_emails = [doc["email"] async for doc in admin_cursor]