Skip to content

Commit

Permalink
fix: avoid email alias in google directory
Browse files Browse the repository at this point in the history
  • Loading branch information
vncsna committed Jan 30, 2024
1 parent c9522f7 commit 27531e5
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions bd_api/apps/payment/webhooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 27531e5

Please sign in to comment.