Merge "Use oauth token to create GitHub project if available"
This commit is contained in:
commit
3a9b21810c
|
@ -297,9 +297,11 @@ def create_github_project(
|
|||
secure_config = ConfigParser.ConfigParser()
|
||||
secure_config.read(github_secure_config)
|
||||
|
||||
# Project creation doesn't work via oauth
|
||||
ghub = github.Github(secure_config.get("github", "username"),
|
||||
secure_config.get("github", "password"))
|
||||
if secure_config.has_option("github", "oauth_token"):
|
||||
ghub = github.Github(secure_config.get("github", "oauth_token"))
|
||||
else:
|
||||
ghub = github.Github(secure_config.get("github", "username"),
|
||||
secure_config.get("github", "password"))
|
||||
orgs = ghub.get_user().get_orgs()
|
||||
orgs_dict = dict(zip([o.login.lower() for o in orgs], orgs))
|
||||
|
||||
|
|
Loading…
Reference in New Issue