diff --git a/api/apps/tenant_app.py b/api/apps/tenant_app.py index 04588753080..f0f487a8995 100644 --- a/api/apps/tenant_app.py +++ b/api/apps/tenant_app.py @@ -62,8 +62,10 @@ def create(tenant_id): user_id = usrs[0].id user_tenants = UserTenantService.query(user_id=user_id, tenant_id=tenant_id) if user_tenants: - if user_tenants[0].status == UserTenantRole.NORMAL.value: + if user_tenants[0].role == UserTenantRole.NORMAL: return get_data_error_result(message="This user is in the team already.") + if user_tenants[0].role == UserTenantRole.OWNER: + return get_data_error_result(message="This user is the owner of the team.") return get_data_error_result(message="Invitation notification is sent.") UserTenantService.save(