Fix slack message icon override (#41212)
* Fix slack message icon override Allows overriding the icon for individual slack messages using either an emoji or a URL. * Run python3 -m script.gen_requirements_all * Add period to first line * Add support for python 3.7 testing AsyncMock is only available from python 3.8+. Prior to this, CoroutineMock is used which doesn't mock the method so it needs to be done manually. * Fix tests for python3.7 compatibility The Python3.7 mock call object doesn't have the kwargs helper property. * Update default emoji test docstring
This commit is contained in:
1 parent
e64b8774ec
commit
a1f70e11ae
4 files changed
+73
-2
No files matched your search
@@ -209,8 +209,9 @@ class SlackNotificationService(BaseNotificationService):
|
||||
"username": username,
|
||||
}
|
||||
|
||||
if self._icon:
|
||||
if self._icon.lower().startswith(("http://", "https://")):
|
||||
icon = icon or self._icon
|
||||
if icon:
|
||||
if icon.lower().startswith(("http://", "https://")):
|
||||
icon_type = "url"
|
||||
else:
|
||||
icon_type = "emoji"
|
||||
|
||||
Reference in new issue
Block a user