def select_repo(token): repos = github.get('user/repos', access_token=token, all_pages=True) form = RepoForm.create( repos=[ (repo['full_name'], repo['full_name']) for repo in repos ], ) if form.validate(): project_service.create(form.repo.data, token) db.session.commit() return 'Repo {} selected.'.format(form.repo.data) return render_template( 'select_repo.html', form=form, )
def _fetch_commits(project, commits_url): return github.get( commits_url[len(github.base_url):], access_token=project.access_token, all_pages=True, )