endpoints.callbacks: add github-git service URL
This commit is contained in:
parent
89efb9f62c
commit
e1def540da
1 changed files with 4 additions and 2 deletions
|
@ -248,6 +248,7 @@ def github_oauth_attach():
|
|||
|
||||
@callback.route('/github/callback/trigger/<path:repository>', methods=['GET'])
|
||||
@callback.route('/github/callback/trigger/<path:repository>/__new', methods=['GET'])
|
||||
@callback.route('/github/callback/trigger/<path:repostiory>/__git', methods=['GET'])
|
||||
@route_show_if(features.GITHUB_BUILD)
|
||||
@require_session_login
|
||||
@parse_repository_name
|
||||
|
@ -260,7 +261,8 @@ def attach_github_build_trigger(namespace, repository):
|
|||
msg = 'Invalid repository: %s/%s' % (namespace, repository)
|
||||
abort(404, message=msg)
|
||||
|
||||
trigger = model.create_build_trigger(repo, 'github', token, current_user.db_user())
|
||||
service_name = 'github-git' if '__git' in request.url else 'github'
|
||||
trigger = model.create_build_trigger(repo, service_name, token, current_user.db_user())
|
||||
|
||||
# TODO(jschorr): Remove once the new layout is in place.
|
||||
admin_path = '%s/%s/%s' % (namespace, repository, 'admin')
|
||||
|
@ -273,7 +275,7 @@ def attach_github_build_trigger(namespace, repository):
|
|||
trigger.uuid)
|
||||
|
||||
|
||||
logger.debug('Redirecting to full url: %s' % full_url)
|
||||
logger.debug('Redirecting to full url: %s', full_url)
|
||||
return redirect(full_url)
|
||||
|
||||
abort(403)
|
||||
|
|
Reference in a new issue