custom trigger: initial setup wizard
This commit is contained in:
parent
c5272f3545
commit
7d1d53ebcb
8 changed files with 86 additions and 31 deletions
|
@ -277,27 +277,3 @@ def attach_github_build_trigger(namespace, repository):
|
|||
return redirect(full_url)
|
||||
|
||||
abort(403)
|
||||
|
||||
@callback.route('/custom/callback/trigger/<path:repository>', methods=['GET'])
|
||||
@callback.route('/custom/callback/trigger/<path:repository>/__new', methods=['GET'])
|
||||
@require_session_login
|
||||
@parse_repository_name
|
||||
def activate_custom_build_trigger(namespace, repository):
|
||||
permission = AdministerRepositoryPermission(namespace, repository)
|
||||
if permission.can():
|
||||
repo = model.get_repository(namespace, repository)
|
||||
if not repo:
|
||||
msg = 'Invalid repository: %s/%s' % (namespace, repository)
|
||||
abort(404, message=msg)
|
||||
|
||||
trigger = model.create_build_trigger(repo, 'custom', None, current_user.db_user())
|
||||
|
||||
# TODO(jschorr): Remove once the new layout is in place.
|
||||
admin_path = '%s/%s/%s' % (namespace, repository, 'admin')
|
||||
full_url = '%s%s%s' % (url_for('web.repository', path=admin_path), '?tab=trigger&new_trigger=',
|
||||
trigger.uuid)
|
||||
|
||||
logger.debug('Redirecting to full url: %s', full_url)
|
||||
return redirect(full_url)
|
||||
|
||||
abort(403)
|
||||
|
|
Reference in a new issue