Skip to content
Snippets Groups Projects
Commit cc1b3a36 authored by Charlotte Hausman's avatar Charlotte Hausman
Browse files

Merge branch 'fix_closing' into 'main'

close requests for real

See merge request !1340
parents fb7acb15 19da180f
No related branches found
Tags 2.8.1 2.8.1-rc3
2 merge requests!1390Catch up with Main,!1340close requests for real
Pipeline #9764 passed
......@@ -152,14 +152,14 @@ export class RequestOperationsComponent implements OnInit {
}
/**
* The request is closable if it's failed in an error state.
* The request is closable if it's failed or in an error state.
*/
isRequestCloseable(): boolean {
return (
this.selectedVersion &&
this.selectedVersion.state === 'Error' &&
this.selectedVersion.current_execution.state_name === 'Error'
)
(this.selectedVersion.state === 'Error' || this.selectedVersion.state === 'Failed') &&
(this.selectedVersion.current_execution.state_name === 'Error' || this.selectedVersion.current_execution.state_name === 'Failed')
);
}
public loadDefaultCC() {
......
......@@ -227,6 +227,12 @@ def close_capability_request(request: Request) -> Response:
if capability_request:
if capability_request.state == "Failed":
capability_request.update_sealed(True)
try:
request.capability_info.save_entity(capability_request)
except Exception as exc:
detail = f"sealing of {capability_request.id} failed: {exc}"
return HTTPBadRequest(detail=detail)
return Response(body=f"Capability request with ID {request_id} successfully closed.")
else:
not_failed_msg = f"Capability with ID {request_id} is not in a failed state and cannot be closed."
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment