Merge pull request #1197 from coreos-inc/webpytest
Tests for endpoints/web and some small fixes
This commit is contained in:
commit
904b2d53d2
3 changed files with 168 additions and 11 deletions
|
@ -614,18 +614,19 @@ def attach_bitbucket_trigger(namespace, repository_name):
|
|||
|
||||
try:
|
||||
oauth_info = BuildTriggerHandler.get_handler(trigger).get_oauth_url()
|
||||
|
||||
config = {
|
||||
'access_token': oauth_info['access_token']
|
||||
}
|
||||
|
||||
access_token_secret = oauth_info['access_token_secret']
|
||||
model.build.update_build_trigger(trigger, config, auth_token=access_token_secret)
|
||||
|
||||
return redirect(oauth_info['url'])
|
||||
except TriggerProviderException:
|
||||
trigger.delete_instance()
|
||||
abort(400, message='Could not retrieve OAuth URL from Bitbucket')
|
||||
logger.debug('Could not retrieve Bitbucket OAuth URL')
|
||||
abort(500)
|
||||
|
||||
config = {
|
||||
'access_token': oauth_info['access_token']
|
||||
}
|
||||
|
||||
access_token_secret = oauth_info['access_token_secret']
|
||||
model.build.update_build_trigger(trigger, config, auth_token=access_token_secret)
|
||||
|
||||
return redirect(oauth_info['url'])
|
||||
|
||||
abort(403)
|
||||
|
||||
|
|
Reference in a new issue