Commit f4f06d00 authored by Douwe Maan's avatar Douwe Maan

Merge branch 'lfs-helper-doc-link' into 'master'

Use GitLab Routing helpers for the documentation URL in `LfsHelper`

To reduce conflicts from changes introduced in gitlab-org/gitlab-ee!740

https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/740#note_15782550

See merge request !6529
parents edebd5e7 927ab56c
module LfsHelper module LfsHelper
include Gitlab::Routing.url_helpers
def require_lfs_enabled! def require_lfs_enabled!
return if Gitlab.config.lfs.enabled return if Gitlab.config.lfs.enabled
render( render(
json: { json: {
message: 'Git LFS is not enabled on this GitLab server, contact your admin.', message: 'Git LFS is not enabled on this GitLab server, contact your admin.',
documentation_url: "#{Gitlab.config.gitlab.url}/help", documentation_url: help_url,
}, },
status: 501 status: 501
) )
...@@ -46,7 +48,7 @@ module LfsHelper ...@@ -46,7 +48,7 @@ module LfsHelper
render( render(
json: { json: {
message: 'Access forbidden. Check your access level.', message: 'Access forbidden. Check your access level.',
documentation_url: "#{Gitlab.config.gitlab.url}/help", documentation_url: help_url,
}, },
content_type: "application/vnd.git-lfs+json", content_type: "application/vnd.git-lfs+json",
status: 403 status: 403
...@@ -57,7 +59,7 @@ module LfsHelper ...@@ -57,7 +59,7 @@ module LfsHelper
render( render(
json: { json: {
message: 'Not found.', message: 'Not found.',
documentation_url: "#{Gitlab.config.gitlab.url}/help", documentation_url: help_url,
}, },
content_type: "application/vnd.git-lfs+json", content_type: "application/vnd.git-lfs+json",
status: 404 status: 404
......
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