Skip to content

Commit

Permalink
Fix UnicodeEncodeError for non-Latin characters (#6715)
Browse files Browse the repository at this point in the history
  • Loading branch information
dvandonkelaar authored Jan 18, 2024
1 parent a54171f commit 30e7392
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion redash/destinations/slack.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def notify(self, alert, query, user, new_state, app, host, metadata, options):
payload = {"attachments": [{"text": text, "color": color, "fields": fields}]}

try:
resp = requests.post(options.get("url"), data=json_dumps(payload), timeout=5.0)
resp = requests.post(options.get("url"), data=json_dumps(payload).encode("utf-8"), timeout=5.0)
logging.warning(resp.text)
if resp.status_code != 200:
logging.error("Slack send ERROR. status_code => {status}".format(status=resp.status_code))
Expand Down

0 comments on commit 30e7392

Please sign in to comment.