refactor(backend): update the patch organization api to support organization name updates (#12834)

This commit is contained in:
Hiep Le
2026-02-12 00:08:43 +07:00
committed by GitHub
parent 736f5b2255
commit c856537f65
5 changed files with 189 additions and 0 deletions

View File

@@ -210,6 +210,10 @@ class OrgUpdate(BaseModel):
"""Request model for updating an organization."""
# Basic organization information (any authenticated user can update)
name: Annotated[
str | None,
StringConstraints(strip_whitespace=True, min_length=1, max_length=255),
] = None
contact_name: str | None = None
contact_email: EmailStr | None = None
conversation_expiration: int | None = None

View File

@@ -449,6 +449,11 @@ async def update_org(
status_code=status.HTTP_404_NOT_FOUND,
detail=str(e),
)
except OrgNameExistsError as e:
raise HTTPException(
status_code=status.HTTP_409_CONFLICT,
detail=str(e),
)
except PermissionError as e:
# User lacks permission for LLM settings
raise HTTPException(