diff --git a/notifications/__init__.py b/notifications/__init__.py index 3dc1f76..485f44a 100644 --- a/notifications/__init__.py +++ b/notifications/__init__.py @@ -1 +1 @@ -__version__ = "0.1.0" +__version__ = "0.1.1" diff --git a/notifications/utils.py b/notifications/utils.py index 733a1cb..efadfd1 100644 --- a/notifications/utils.py +++ b/notifications/utils.py @@ -113,6 +113,7 @@ def notify( template=None, context=None, create_link=False, + unfurl_links=False, additional_email_targets=None, attachments: Optional[list[Attachment]] = None, slack_attachments=None, @@ -137,6 +138,7 @@ def notify( slack_text = f'{subject}: {message}' if subject else message api_kwargs = event.slack_api_kwargs() + api_kwargs["unfurl_links"] = unfurl_links if slack_attachments: # TODO: can this be taken from a more "generic" arg and also use it in email? api_kwargs['attachments'] = slack_attachments diff --git a/testapp/tests/test_blocks.py b/testapp/tests/test_blocks.py index 7774bb2..35cc77e 100644 --- a/testapp/tests/test_blocks.py +++ b/testapp/tests/test_blocks.py @@ -83,7 +83,7 @@ def test_templated(self): channel='@someone', icon_emoji=':something:', text='dull version', - unfurl_links=0, + unfurl_links=False, username='NotTestBot', ), ) @@ -128,7 +128,7 @@ def test_message_blocks(self): self.sc_mock.return_value.chat_postMessage.assert_called_once_with( text='*Fruits in bag:* 1\napple\n*Cars in garage:* 2\nfiat\ntesla', channel='@someone', - unfurl_links=0, + unfurl_links=False, username='NotTestBot', as_user=0, icon_emoji=':something:',