use response.text when expecting text (#39533)

This commit is contained in:
Emmanuel Cazenave 2020-02-04 17:26:18 +01:00
parent 0ecaa0d858
commit 5747367a56
1 changed files with 1 additions and 1 deletions

View File

@ -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(