From 32fa6f752e5a38ec165750ba27e4b6601f570eda Mon Sep 17 00:00:00 2001 From: Rameshwaran Mohan Date: Sat, 17 Oct 2026 04:17:43 +0530 Subject: [PATCH] fix(proxy): look up team admin emails with the chunked user query --- litellm/integrations/email_alerting.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/litellm/integrations/email_alerting.py b/litellm/integrations/email_alerting.py index 7b973b254f3..9bff02afd57 100644 --- a/litellm/integrations/email_alerting.py +++ b/litellm/integrations/email_alerting.py @@ -72,9 +72,7 @@ async def get_team_admin_emails(team: LiteLLM_TeamTable, prisma_client: object) """Emails of the members holding the admin role: the user record's email, else the inline one, deduped""" admins: Final = tuple(member for member in team.members_with_roles if member.role == "admin") admin_ids: Final = frozenset(member.user_id for member in admins if member.user_id) - rows: Final = ( - await UserRepository(prisma_client).find_many(where={"user_id": {"in": sorted(admin_ids)}}) if admin_ids else () - ) + rows: Final = await UserRepository(prisma_client).find_many_in("user_id", sorted(admin_ids)) record_emails: Final = MappingProxyType({row.user_id: row.user_email for row in rows if row.user_email}) inline_emails: Final = tuple( member.user_email for member in admins if member.user_email and member.user_id not in record_emails