diff options
Diffstat (limited to 'modules/git_webhooks/__init__.py')
| -rw-r--r-- | modules/git_webhooks/__init__.py | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/modules/git_webhooks/__init__.py b/modules/git_webhooks/__init__.py index 7a1154fb..c847866e 100644 --- a/modules/git_webhooks/__init__.py +++ b/modules/git_webhooks/__init__.py @@ -67,7 +67,7 @@ class Module(ModuleManager.BaseModule): organisation_lower = (organisation or "").lower() branch = handler.branch(data, headers) - current_event, event_action = handler.event(data, headers) + current_events = handler.event(data, headers) unfiltered_targets = [] if "channels" in params: @@ -101,13 +101,12 @@ class Module(ModuleManager.BaseModule): not branch in hook["branches"]): continue - events = [] + hooked_events = [] for hooked_event in hook["events"]: - events.append(handler.event_categories(hooked_event)) - events = list(itertools.chain(*events)) + hooked_events.append(handler.event_categories(hooked_event)) + hooked_events = set(itertools.chain(*hooked_events)) - if (current_event in events or - (event_action and event_action in events)): + if bool(set(current_events)&set(hooked_events)): targets.append([server, channel]) if not targets: |
