Commit f0164abc authored by Ash McKenzie's avatar Ash McKenzie Committed by Ash McKenzie

Move check logic into #batch_operation_disallowed?

parent 051ac7d5
...@@ -98,7 +98,7 @@ class Projects::LfsApiController < Projects::GitHttpClientController ...@@ -98,7 +98,7 @@ class Projects::LfsApiController < Projects::GitHttpClientController
end end
def lfs_check_batch_operation! def lfs_check_batch_operation!
if upload_request? && Gitlab::Database.read_only? if batch_operation_disallowed?
render( render(
json: { json: {
message: lfs_read_only_message message: lfs_read_only_message
...@@ -109,6 +109,11 @@ class Projects::LfsApiController < Projects::GitHttpClientController ...@@ -109,6 +109,11 @@ class Projects::LfsApiController < Projects::GitHttpClientController
end end
end end
# Overridden in EE
def batch_operation_disallowed?
upload_request? && Gitlab::Database.read_only?
end
# Overridden in EE # Overridden in EE
def lfs_read_only_message def lfs_read_only_message
_('You cannot write to this read-only GitLab instance.') _('You cannot write to this read-only GitLab instance.')
......
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