diff --git a/jeepyb/cmd/manage_projects.py b/jeepyb/cmd/manage_projects.py index f125975..721078e 100644 --- a/jeepyb/cmd/manage_projects.py +++ b/jeepyb/cmd/manage_projects.py @@ -276,9 +276,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))