parent
e58e04b0e9
commit
f4f5a065df
1 changed files with 8 additions and 3 deletions
|
@ -273,10 +273,12 @@ class RepositoryBuildList(RepositoryParamResource):
|
||||||
|
|
||||||
# Start the build.
|
# Start the build.
|
||||||
repo = model.repository.get_repository(namespace, repository)
|
repo = model.repository.get_repository(namespace, repository)
|
||||||
|
if repo is None:
|
||||||
|
raise NotFound()
|
||||||
|
|
||||||
build_name = (user_files.get_file_checksum(dockerfile_id)
|
build_name = (user_files.get_file_checksum(dockerfile_id)
|
||||||
if dockerfile_id
|
if dockerfile_id
|
||||||
else hashlib.sha224(archive_url).hexdigest()[0:7])
|
else hashlib.sha224(archive_url).hexdigest()[0:7])
|
||||||
|
|
||||||
prepared = PreparedBuild()
|
prepared = PreparedBuild()
|
||||||
prepared.build_name = build_name
|
prepared.build_name = build_name
|
||||||
|
@ -317,6 +319,9 @@ class RepositoryBuildResource(RepositoryParamResource):
|
||||||
except model.build.InvalidRepositoryBuildException:
|
except model.build.InvalidRepositoryBuildException:
|
||||||
raise NotFound()
|
raise NotFound()
|
||||||
|
|
||||||
|
if build.repository.name != repository or build.repository.namespace_user.username != namespace:
|
||||||
|
raise NotFound()
|
||||||
|
|
||||||
return build_status_view(build)
|
return build_status_view(build)
|
||||||
|
|
||||||
@require_repo_admin
|
@require_repo_admin
|
||||||
|
|
Reference in a new issue