Skip to content

Commit

Permalink
[mattermost] Typo.
Browse files Browse the repository at this point in the history
  • Loading branch information
riga committed Jan 3, 2025
1 parent f1a0482 commit b33cdb6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions law/contrib/mattermost/notification.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
2 changes: 1 addition & 1 deletion law/contrib/mattermost/parameter.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down

0 comments on commit b33cdb6

Please sign in to comment.