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

- make intentionally Failed requests closable

- make sure closing requests saves the change
parent fb7acb15
No related branches found
No related tags found
2 merge requests!1390Catch up with Main,!1340close requests for real
Pipeline #9762 passed
...@@ -152,14 +152,14 @@ export class RequestOperationsComponent implements OnInit { ...@@ -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 { isRequestCloseable(): boolean {
return ( return (
this.selectedVersion && this.selectedVersion &&
this.selectedVersion.state === 'Error' && (this.selectedVersion.state === 'Error' || this.selectedVersion.state === 'Failed') &&
this.selectedVersion.current_execution.state_name === 'Error' (this.selectedVersion.current_execution.state_name === 'Error' || this.selectedVersion.current_execution.state_name === 'Failed')
) );
} }
public loadDefaultCC() { public loadDefaultCC() {
......
...@@ -227,6 +227,12 @@ def close_capability_request(request: Request) -> Response: ...@@ -227,6 +227,12 @@ def close_capability_request(request: Request) -> Response:
if capability_request: if capability_request:
if capability_request.state == "Failed": if capability_request.state == "Failed":
capability_request.update_sealed(True) 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.") return Response(body=f"Capability request with ID {request_id} successfully closed.")
else: else:
not_failed_msg = f"Capability with ID {request_id} is not in a failed state and cannot be closed." 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