Fix slack targets (#3826)

This commit is contained in:
Fabian Affolter 2016-10-12 06:16:11 +02:00 committed by Paulus Schoutsen
parent d302dbec2d
commit 40094cecae

View File

@ -68,7 +68,10 @@ class SlackNotificationService(BaseNotificationService):
"""Send a message to a user."""
import slacker
targets = kwargs.get(ATTR_TARGET, [self._default_channel])
if kwargs.get(ATTR_TARGET) is None:
targets = [self._default_channel]
else:
targets = kwargs.get(ATTR_TARGET)
data = kwargs.get('data')
attachments = data.get('attachments') if data else None