Add schema validation of namespaces and sources methods
This commit is contained in:
parent
57528aa2bc
commit
e025d8c2b2
5 changed files with 96 additions and 9 deletions
|
@ -416,7 +416,7 @@ class BitbucketBuildTrigger(BuildTriggerHandler):
|
|||
'score': 1,
|
||||
}
|
||||
|
||||
return list(namespaces.values())
|
||||
return BuildTriggerHandler.build_namespaces_response(namespaces)
|
||||
|
||||
def list_build_sources_for_namespace(self, namespace):
|
||||
def repo_view(repo):
|
||||
|
@ -437,7 +437,8 @@ class BitbucketBuildTrigger(BuildTriggerHandler):
|
|||
if not result:
|
||||
raise RepositoryReadException('Could not read repository list: ' + err_msg)
|
||||
|
||||
return [repo_view(repo) for repo in data if repo['owner'] == namespace]
|
||||
repos = [repo_view(repo) for repo in data if repo['owner'] == namespace]
|
||||
return BuildTriggerHandler.build_sources_response(repos)
|
||||
|
||||
def list_build_subdirs(self):
|
||||
config = self.config
|
||||
|
|
Reference in a new issue