Update deployment configuration for a project. Updates the HostingProjectModel with the provided values. Only non-None values in the request will be updated.
(
self,
project_id: str,
body: UpdateDeploymentRequest,
orm: Session = Depends(get_orm_session),
)
| 116 | |
| 117 | class UpdateDeploymentView(BaseDeploymentView): |
| 118 | async def __call__( |
| 119 | self, |
| 120 | project_id: str, |
| 121 | body: UpdateDeploymentRequest, |
| 122 | orm: Session = Depends(get_orm_session), |
| 123 | ) -> StatusResponse: |
| 124 | """ |
| 125 | Update deployment configuration for a project. |
| 126 | |
| 127 | Updates the HostingProjectModel with the provided values. |
| 128 | Only non-None values in the request will be updated. |
| 129 | """ |
| 130 | project: HostingProjectModel = await self.get_hosting_project(orm, project_id) |
| 131 | |
| 132 | for field_name, field_value in body.model_dump(exclude_none=True).items(): |
| 133 | if hasattr(project, field_name): |
| 134 | setattr(project, field_name, field_value) |
| 135 | |
| 136 | orm.commit() |
| 137 | |
| 138 | return StatusResponse( |
| 139 | success=True, |
| 140 | message="Deployment configuration updated successfully", |
| 141 | ) |
| 142 | |
| 143 | |
| 144 | class InitiateBuildView(BaseDeploymentView): |
nothing calls this directly
no test coverage detected