From 201d86ba4dd0deb694afce27fe5872831504ef4d Mon Sep 17 00:00:00 2001 From: evilhero Date: Fri, 3 Aug 2018 16:19:52 -0400 Subject: [PATCH] FIX: (#2047) when using slack, would error on notifying during post-processing due to invalid reference --- mylar/notifiers.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/mylar/notifiers.py b/mylar/notifiers.py index b7a9081e..1255de60 100644 --- a/mylar/notifiers.py +++ b/mylar/notifiers.py @@ -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,