From 5747367a563adea2e7b96fe7198da2505ddbbd97 Mon Sep 17 00:00:00 2001 From: Emmanuel Cazenave Date: Tue, 4 Feb 2020 17:26:18 +0100 Subject: [PATCH] use response.text when expecting text (#39533) --- atreal_openads/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/atreal_openads/models.py b/atreal_openads/models.py index 62da779..ab5ce00 100644 --- a/atreal_openads/models.py +++ b/atreal_openads/models.py @@ -1072,7 +1072,7 @@ class AtrealOpenads(BaseResource, HTTPResource, BaseModel): # TODO ask for openADS.API to *always* send JSON formatted errors, not HTML ones # return a string representing the HTTP error (filtering the HTML tags and multispaces) - detail = clean_spaces(strip_tags(response.content[:1000])) if response.content else '' + detail = clean_spaces(strip_tags(response.text[:1000])) if response.text else '' return u"HTTP error: %s%s" % (response.status_code, ', ' + detail if detail else '') @endpoint(