diff --git a/src/organisation/router.py b/src/organisation/router.py index ce8aaf2..f0f212a 100644 --- a/src/organisation/router.py +++ b/src/organisation/router.py @@ -352,6 +352,7 @@ async def add_user_to_org( raise ConflictException(message="User already a part of this organisation") org_model.user_rel.append(user_model) db.flush() + await assign_default_user_group(db=db, org_model=org_model, user_model=user_model) response = { "organisation": org_model, "users": [{"id": user.id, "email": user.email} for user in org_model.user_rel], diff --git a/src/user/router.py b/src/user/router.py index a561be4..c4b5379 100644 --- a/src/user/router.py +++ b/src/user/router.py @@ -10,6 +10,7 @@ Endpoints: from fastapi import APIRouter, status, BackgroundTasks +from src.iam.service import assign_default_user_group from src.organisation.exceptions import OrgNotFoundException from src.user.schemas import ( UserResponse, @@ -199,6 +200,7 @@ async def accept_invitation( org_model.user_rel.append(user_model) db.flush() + await assign_default_user_group(db=db, org_model=org_model, user_model=user_model) response = { "organisation": org_model,