Skip to content

Commit

Permalink
fix: set default google group env var inside function (#483)
Browse files Browse the repository at this point in the history
  • Loading branch information
vncsna authored Nov 12, 2023
1 parent fd2c8dc commit 624b9fd
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions bd_api/apps/payment/webhooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,10 @@ def get_service() -> Resource:
return build("admin", "directory_v1", credentials=credentials)


def add_user(
email: str,
role: str = "MEMBER",
group_key: str = settings.GOOGLE_DIRECTORY_GROUP_KEY,
):
def add_user(email: str, group_key: str, role: str = "MEMBER"):
"""Add user to google group"""
if not group_key:
group_key = settings.GOOGLE_DIRECTORY_GROUP_KEY
try:
service = get_service()
service.members().insert(
Expand All @@ -53,11 +51,10 @@ def add_user(
raise e


def remove_user(
email: str,
group_key: str = settings.GOOGLE_DIRECTORY_GROUP_KEY,
) -> None:
def remove_user(email: str, group_key: str) -> None:
"""Remove user from google group"""
if not group_key:
group_key = settings.GOOGLE_DIRECTORY_GROUP_KEY
try:
service = get_service()
service.members().delete(
Expand Down

0 comments on commit 624b9fd

Please sign in to comment.