Merge pull request #2246 from coreos-inc/build-none-error
Add check for None repository in start build API
This commit is contained in:
commit
cc9e8cd2d0
1 changed files with 8 additions and 3 deletions
|
@ -273,6 +273,8 @@ class RepositoryBuildList(RepositoryParamResource):
|
|||
|
||||
# Start the build.
|
||||
repo = model.repository.get_repository(namespace, repository)
|
||||
if repo is None:
|
||||
raise NotFound()
|
||||
|
||||
build_name = (user_files.get_file_checksum(dockerfile_id)
|
||||
if dockerfile_id
|
||||
|
@ -317,6 +319,9 @@ class RepositoryBuildResource(RepositoryParamResource):
|
|||
except model.build.InvalidRepositoryBuildException:
|
||||
raise NotFound()
|
||||
|
||||
if build.repository.name != repository or build.repository.namespace_user.username != namespace:
|
||||
raise NotFound()
|
||||
|
||||
return build_status_view(build)
|
||||
|
||||
@require_repo_admin
|
||||
|
|
Reference in a new issue