From b33cdb6209e5bacc5855223cef966e2ccaea4590 Mon Sep 17 00:00:00 2001 From: "Marcel R." Date: Fri, 3 Jan 2025 17:35:06 +0100 Subject: [PATCH] [mattermost] Typo. --- law/contrib/mattermost/notification.py | 12 ++++++------ law/contrib/mattermost/parameter.py | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/law/contrib/mattermost/notification.py b/law/contrib/mattermost/notification.py index 84e5aa08..6d6963ea 100644 --- a/law/contrib/mattermost/notification.py +++ b/law/contrib/mattermost/notification.py @@ -37,17 +37,17 @@ def notify_mattermost( # get default settings if not hook_url: - hook_url = cfg.get_expanded("notifications", "mattermost_hook_url") + hook_url = cfg.get_expanded("notifications", "mattermost_hook_url", default=None) if not channel: - channel = cfg.get_expanded("notifications", "mattermost_channel") + channel = cfg.get_expanded("notifications", "mattermost_channel", default=None) if not user: - user = cfg.get_expanded("notifications", "mattermost_user") + user = cfg.get_expanded("notifications", "mattermost_user", default=None) if not mention_user: - mention_user = cfg.get_expanded("notifications", "mattermost_mention_user") + mention_user = cfg.get_expanded("notifications", "mattermost_mention_user", default=None) if not icon_url: - icon_url = cfg.get_expanded("notifications", "mattermost_icon_url") + icon_url = cfg.get_expanded("notifications", "mattermost_icon_url", default=None) if not icon_emoji: - icon_emoji = cfg.get_expanded("notifications", "mattermost_icon_emoji") + icon_emoji = cfg.get_expanded("notifications", "mattermost_icon_emoji", default=None) if not hook_url: logger.warning("cannot send Mattermost notification, hook_url ({}) empty".format(hook_url)) diff --git a/law/contrib/mattermost/parameter.py b/law/contrib/mattermost/parameter.py index d4c61f05..a70e147f 100644 --- a/law/contrib/mattermost/parameter.py +++ b/law/contrib/mattermost/parameter.py @@ -30,7 +30,7 @@ def notify(success, title, content, **kwargs): # overwrite title cfg = Config.instance() - header = cfg.get_expanded("notifications", "mattermost_header") + header = cfg.get_expanded("notifications", "mattermost_header", default=None) task_block = "```\n{}\n```".format(content["Task"]) title = "{}\n{}".format(header, task_block) if header else task_block del content["Task"]