Don't try to parse username and repo name from a full name if there's no full

name (github.py)
This commit is contained in:
jesopo 2019-01-16 22:28:12 +00:00
parent a342f82f40
commit 77c7084e9d

View file

@ -126,14 +126,16 @@ class Module(ModuleManager.BaseModule):
github_event = event["headers"]["X-GitHub-Event"] github_event = event["headers"]["X-GitHub-Event"]
full_name = None full_name = None
repo_username = None
repo_name = None
if "respository" in data: if "respository" in data:
full_name = data["repository"]["full_name"] full_name = data["repository"]["full_name"]
repo_username, repo_name = full_name.split("/", 1)
organisation = None organisation = None
if "organization" in data: if "organization" in data:
organisation = data["organization"]["login"] organisation = data["organization"]["login"]
repo_username, repo_name = full_name.split("/", 1)
hooks = self.bot.database.channel_settings.find_by_setting( hooks = self.bot.database.channel_settings.find_by_setting(
"github-hook") "github-hook")
targets = [] targets = []