Handle OnCall gateway connector delete 204 (#1313)

Deleting an oncall connector from the gateway returns a 204 so it should
not try to parse the response for json.
This commit is contained in:
Michael Derynck 2023-02-17 11:04:02 -07:00 committed by GitHub
parent 1eb6db023e
commit ca987efd55
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 8 deletions

View file

@ -10,6 +10,7 @@ assignees: ''
Hi, thank you for opening an issue!
Here is a quick checklist:
- [ ] Is it about Cloud or Open Source OnCall?
- [ ] Add OnCall backend & frontend versions.
- [ ] Include labels starting with "part:". Like `part:alertflow` or `part:schedules`.

View file

@ -52,14 +52,7 @@ class OnCallGatewayAPIClient:
def delete_oncall_connector(self, oncall_org_id: str) -> requests.models.Response:
url = urljoin(f"{self._oncall_connectors_url}/", oncall_org_id)
response = self._delete(url=url)
response_data = response.json()
return (
OnCallConnector(
response_data["oncall_org_id"],
response_data["backend"],
),
response,
)
return response
# Slack Connector
@property