Commit 46fd485c authored by Kamil Trzcinski's avatar Kamil Trzcinski

Fix API implementation

parent 55701d9c
...@@ -79,9 +79,7 @@ module API ...@@ -79,9 +79,7 @@ module API
return redirect_to build.artifacts_file.url return redirect_to build.artifacts_file.url
end end
unless artifacts_file.exists? return not_found! unless artifacts_file.exists?
not_found!
end
present_file!(artifacts_file.path, artifacts_file.filename) present_file!(artifacts_file.path, artifacts_file.filename)
end end
......
...@@ -406,7 +406,7 @@ module API ...@@ -406,7 +406,7 @@ module API
repo_obj.artifacts_download_url repo_obj.artifacts_download_url
end end
end end
expose :artifacts_file, using: BuildArtifactFile, if: lambda { |build, opts| build.artifacts? } expose :artifacts_file, using: BuildArtifactFile, if: -> (build, opts) { build.artifacts? }
expose :commit, with: RepoCommit do |repo_obj, _options| expose :commit, with: RepoCommit do |repo_obj, _options|
if repo_obj.respond_to?(:commit) if repo_obj.respond_to?(:commit)
repo_obj.commit.commit_data repo_obj.commit.commit_data
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment