Get detailed information for a specific organization, including its members. Optimized to only load users (needed for response), not projects or invites.
(
*,
request: Request,
org_id: str,
orm: Session = Depends(get_orm_session),
)
| 203 | |
| 204 | |
| 205 | def get_org( |
| 206 | *, |
| 207 | request: Request, |
| 208 | org_id: str, |
| 209 | orm: Session = Depends(get_orm_session), |
| 210 | ) -> OrgDetailResponse: |
| 211 | """ |
| 212 | Get detailed information for a specific organization, including its members. |
| 213 | |
| 214 | Optimized to only load users (needed for response), not projects or invites. |
| 215 | """ |
| 216 | org: Optional[OrgModel] = OrgModel.get_by_id_for_detail(orm, org_id) |
| 217 | |
| 218 | if not org or not org.is_user_member(request.state.session.user_id): |
| 219 | raise HTTPException(status_code=404, detail="Organization not found") |
| 220 | |
| 221 | org.set_current_user(request.state.session.user_id) |
| 222 | |
| 223 | return OrgDetailResponse.model_validate(org) |
| 224 | |
| 225 | |
| 226 | def create_org( |
searching dependent graphs…