From 27531e5e31b16093fc36c565bca6113bce367990 Mon Sep 17 00:00:00 2001 From: Vinicius Date: Tue, 30 Jan 2024 08:43:13 -0300 Subject: [PATCH] fix: avoid email alias in google directory --- bd_api/apps/payment/webhooks.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bd_api/apps/payment/webhooks.py b/bd_api/apps/payment/webhooks.py index 993e2d6a..abdc5a83 100644 --- a/bd_api/apps/payment/webhooks.py +++ b/bd_api/apps/payment/webhooks.py @@ -51,6 +51,8 @@ def add_user(email: str, group_key: str = None, role: str = "MEMBER"): """Add user to google group""" if not group_key: group_key = settings.GOOGLE_DIRECTORY_GROUP_KEY + if "+" in email and email.index("+") < email.index("@"): + email = email.split("+")[0] + "@" + email.split("@")[1] try: service = get_service() service.members().insert(