From f4bd4653e91ddd0e08cd0e437c7dedda84518c55 Mon Sep 17 00:00:00 2001 From: Joe <1264204425@qq.com> Date: Wed, 16 Oct 2024 17:06:01 +0800 Subject: [PATCH] feat: update invite member --- api/services/account_service.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/api/services/account_service.py b/api/services/account_service.py index f0a27d8fa9..527aa64895 100644 --- a/api/services/account_service.py +++ b/api/services/account_service.py @@ -785,12 +785,17 @@ class RegisterService: provider: Optional[str] = None, language: Optional[str] = None, status: Optional[AccountStatus] = None, + is_setup: Optional[bool] = False, ) -> Account: db.session.begin_nested() """Register account""" try: account = AccountService.create_account( - email=email, name=name, interface_language=language or languages[0], password=password + email=email, + name=name, + interface_language=language or languages[0], + password=password, + is_setup=is_setup, ) account.status = AccountStatus.ACTIVE.value if not status else status.value account.initialized_at = datetime.now(timezone.utc).replace(tzinfo=None) @@ -825,7 +830,9 @@ class RegisterService: TenantService.check_member_permission(tenant, inviter, None, "add") name = email.split("@")[0] - account = cls.register(email=email, name=name, language=language, status=AccountStatus.PENDING) + account = cls.register( + email=email, name=name, language=language, status=AccountStatus.PENDING, is_setup=True + ) # Create new tenant member for invited tenant TenantService.create_tenant_member(tenant, account, role) TenantService.switch_tenant(account, tenant.id)