Fix bugs, mostly related to date formatting.
This commit is contained in:
parent
ddf5f2053c
commit
3542a520f5
11 changed files with 42 additions and 40 deletions
|
@ -10,7 +10,7 @@ from app import app
|
|||
from endpoints.api import (RepositoryParamResource, nickname, resource, require_repo_admin,
|
||||
log_action, request_error, query_param, parse_args,
|
||||
validate_json_request)
|
||||
from endpoints.api.build import build_status_view
|
||||
from endpoints.api.build import build_status_view, trigger_view
|
||||
from endpoints.common import start_build
|
||||
from endpoints.trigger import (BuildTrigger, TriggerDeactivationException,
|
||||
TriggerActivationException, EmptyRepositoryException)
|
||||
|
@ -21,21 +21,6 @@ from auth.permissions import UserPermission
|
|||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
def trigger_view(trigger):
|
||||
if trigger and trigger.uuid:
|
||||
config_dict = json.loads(trigger.config)
|
||||
build_trigger = BuildTrigger.get_trigger_for_service(trigger.service.name)
|
||||
return {
|
||||
'service': trigger.service.name,
|
||||
'config': config_dict,
|
||||
'id': trigger.uuid,
|
||||
'connected_user': trigger.connected_user.username,
|
||||
'is_active': build_trigger.is_active(config_dict)
|
||||
}
|
||||
|
||||
return None
|
||||
|
||||
|
||||
def _prepare_webhook_url(scheme, username, password, hostname, path):
|
||||
auth_hostname = '%s:%s@%s' % (quote(username), quote(password), hostname)
|
||||
return urlunparse((scheme, auth_hostname, path, '', '', ''))
|
||||
|
|
Reference in a new issue