From 3e4d7b395332190586c029573e6f5df7f4c1b816 Mon Sep 17 00:00:00 2001 From: Matrozov Date: Fri, 28 Jan 2022 17:10:20 +0300 Subject: [PATCH] Fix actions --- .gitignore | 5 +++++ notify_events/__init__.py | 2 +- notify_events/message.py | 5 +++-- setup.py | 2 +- my.py => test.py | 0 5 files changed, 10 insertions(+), 4 deletions(-) rename my.py => test.py (100%) diff --git a/.gitignore b/.gitignore index bb40183..8e80ca5 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,8 @@ +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + # Distribution / packaging .Python build/ diff --git a/notify_events/__init__.py b/notify_events/__init__.py index 9bb1905..3c9938d 100644 --- a/notify_events/__init__.py +++ b/notify_events/__init__.py @@ -1,3 +1,3 @@ from .message import Message -__version__ = "1.1.2" \ No newline at end of file +__version__ = "1.1.3" \ No newline at end of file diff --git a/notify_events/message.py b/notify_events/message.py index 0df4af4..356edbd 100644 --- a/notify_events/message.py +++ b/notify_events/message.py @@ -135,8 +135,9 @@ def send(self, channel_token: str): data['actions[' + str(idx) + '][callback_method]'] = action['callback_method'] data['actions[' + str(idx) + '][callback_content]'] = action['callback_content'] - for key, value in action['callback_headers'].items(): - data['actions[' + str(idx) + '][callback_headers][' + urllib.parse.quote_plus(key) + ']'] = value + if isinstance(action['callback_headers'], dict): + for key, value in action['callback_headers'].items(): + data['actions[' + str(idx) + '][callback_headers][' + urllib.parse.quote_plus(key) + ']'] = value url = self._base_url % channel_token diff --git a/setup.py b/setup.py index 8e8b96e..14310f9 100644 --- a/setup.py +++ b/setup.py @@ -10,7 +10,7 @@ # This call to setup() does all the work setup( name="notify_events", - version="1.1.2", + version="1.1.3", description="Extension to integrate your project with Notify.Events service.", long_description=README, long_description_content_type="text/markdown", diff --git a/my.py b/test.py similarity index 100% rename from my.py rename to test.py