Skip to content

Commit

Permalink
Merge pull request #21 from chaordic/fix/unicode
Browse files Browse the repository at this point in the history
fix/uptime: encode only when it is unicode
  • Loading branch information
raphapr authored Jan 4, 2020
2 parents 63c1acd + d279829 commit a2472a0
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions library/statuscake_uptime.py
Original file line number Diff line number Diff line change
Expand Up @@ -387,11 +387,10 @@ def convert(self, req_data):
req_data = ({k: req_data[k] for k in req_data.keys()
if k in self.data.keys()})
for key in req_data.keys():
if type(req_data[key]) is list:
req_data[key] = [item.encode('UTF8') for item in req_data[key]]
req_data[key] = ','.join(req_data[key])
if type(req_data[key]) is unicode:
req_data[key] = req_data[key].encode('UTF-8')
if isinstance(req_data[key],list):
req_data[key] = to_native(','.join(req_data[key]))
if isinstance(req_data[key],unicode):
req_data[key] = to_native(req_data[key])
if req_data[key] is True:
req_data[key] = 1
if req_data[key] is False:
Expand Down

0 comments on commit a2472a0

Please sign in to comment.