1
0
Fork 0
mirror of https://github.com/evilhero/mylar synced 2025-01-03 13:34:33 +00:00

FIX: (#2047) when using slack, would error on notifying during post-processing due to invalid reference

This commit is contained in:
evilhero 2018-08-03 16:19:52 -04:00
parent 41f19fb8f6
commit 201d86ba4d

View file

@ -482,16 +482,18 @@ class TELEGRAM:
class SLACK:
def __init__(self, test_webhook_url=None):
self.webhook_url = mylar.CONFIG.SLACK_WEBHOOK_URL if test_webhook_url is None else test_webhook_url
def notify(self, text, attachment_text, snatched_nzb=None, prov=None, sent_to=None, module=None):
if module is None:
module = ''
module += '[NOTIFIER]'
if sent_to is None:
attachment_text += ' from ' + prov
if all([sent_to is not None, prov is not None]):
attachment_text += ' from %s and sent to %s' % (prov, sent_to)
elif sent_to is None:
attachment_text += ' from %s' % prov
else:
attachment_text += ' from ' + prov + ' and sent to ' + sent_to
pass
payload = {
# "text": text,