Browse Source

Fixed issue with posting notification to Slack webhook

Changed the POST data to JSON
pull/7289/head
Udayakiran Kallavi 6 years ago
committed by GitHub
parent
commit
95588b11cb
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      couchpotato/core/notifications/webhook.py

5
couchpotato/core/notifications/webhook.py

@ -1,4 +1,5 @@
import traceback
import json
from couchpotato.core.helpers.encoding import toUnicode
from couchpotato.core.helpers.variable import getIdentifier
@ -25,11 +26,11 @@ class Webhook(Notification):
})
headers = {
'Content-type': 'application/x-www-form-urlencoded'
'Content-type': 'application/json'
}
try:
self.urlopen(self.conf('url'), headers = headers, data = post_data, show_error = False)
self.urlopen(self.conf('url'), headers = headers, data = json.dumps(post_data), show_error = False)
return True
except:
log.error('Webhook notification failed: %s', traceback.format_exc())

Loading…
Cancel
Save