diff options
| author | 2018-11-06 14:09:13 +0000 | |
|---|---|---|
| committer | 2018-11-06 14:09:13 +0000 | |
| commit | f06c824ae93c6d91096f307bd0a46ff398e1d07d (patch) | |
| tree | b45dce0e676af8a0001b48552ec7504e80684084 | |
| parent | Allow a `json.loads` error in modules/github.py to bubble back up to (diff) | |
| signature | ||
Only count a `None` response from an API event hook to be a 404
| -rw-r--r-- | modules/github.py | 4 | ||||
| -rw-r--r-- | modules/rest_api.py | 2 |
2 files changed, 4 insertions, 2 deletions
diff --git a/modules/github.py b/modules/github.py index bc3e1ad4..3683cef3 100644 --- a/modules/github.py +++ b/modules/github.py @@ -19,7 +19,7 @@ class Module(ModuleManager.BaseModule): if not full_name in values: hooks.pop(i) if not hooks: - return + return None github_event = event["headers"]["X-GitHub-Event"] @@ -47,6 +47,8 @@ class Module(ModuleManager.BaseModule): trigger = self._make_trigger(channel, server, output) self.bot.trigger(trigger) + return True + def _make_trigger(self, channel, server, line): return lambda: self.events.on("send.stdout").call( target=channel, module_name="Github", server=server, message=line) diff --git a/modules/rest_api.py b/modules/rest_api.py index 1635e8b7..24e969ba 100644 --- a/modules/rest_api.py +++ b/modules/rest_api.py @@ -35,7 +35,7 @@ class Handler(http.server.BaseHTTPRequestHandler): except: code = 500 - if event_response: + if not event_response == None: response = json.dumps(event_response, sort_keys=True, indent=4) code = 200 |
