Create a new organization in the database. Args: name (str): The name of the organization Returns: OrganizationDB: instance of organization
(name: str)
| 1097 | |
| 1098 | |
| 1099 | async def create_organization(name: str): |
| 1100 | """Create a new organization in the database. |
| 1101 | |
| 1102 | Args: |
| 1103 | name (str): The name of the organization |
| 1104 | |
| 1105 | Returns: |
| 1106 | OrganizationDB: instance of organization |
| 1107 | """ |
| 1108 | |
| 1109 | async with engine.core_session() as session: |
| 1110 | organization_db = OrganizationDB(name=name) |
| 1111 | |
| 1112 | session.add(organization_db) |
| 1113 | |
| 1114 | log.info( |
| 1115 | "[scopes] organization created", |
| 1116 | organization_id=organization_db.id, |
| 1117 | ) |
| 1118 | |
| 1119 | await session.commit() |
| 1120 | |
| 1121 | return organization_db |
| 1122 | |
| 1123 | |
| 1124 | async def create_workspace(name: str, organization_id: str): |
no test coverage detected