fix(integrations): add back response.raise_for_status()

It got removed in 59ca074780, however it
should still be here, the point of that commit was to fix other
behaviour, don't exactly remember why it was removed.

Signed-off-by: Akhil Narang <me@akhilnarang.dev>
This commit is contained in:
Akhil Narang 2024-05-08 15:14:41 +05:30
parent a623d1b285
commit 19b696acf6
No known key found for this signature in database
GPG key ID: 9DCC61E211BF645F

View file

@ -19,6 +19,8 @@ def make_request(method: str, url: str, auth=None, headers=None, data=None, json
response = frappe.flags.integration_request = s.request(
method, url, data=data, auth=auth, headers=headers, json=json, params=params
)
response.raise_for_status()
content_type = response.headers.get("content-type")
if content_type == "text/plain; charset=utf-8":
return parse_qs(response.text)