summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAsh McKenzie <amckenzie@gitlab.com>2018-06-13 12:29:58 +1000
committerAsh McKenzie <amckenzie@gitlab.com>2018-07-02 17:29:09 +1000
commit4203a8b30b9f9b1a060f9f377592f7d29e542e7c (patch)
tree927bf71cad5dff0f0c67f71cfb2524861e5d1036
parent26bea57883f01ef304465a93d3a8a9b611abc178 (diff)
downloadgitlab-ce-4203a8b30b9f9b1a060f9f377592f7d29e542e7c.tar.gz
Move check logic into #batch_operation_disallowed?
-rw-r--r--app/controllers/projects/lfs_api_controller.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/app/controllers/projects/lfs_api_controller.rb b/app/controllers/projects/lfs_api_controller.rb
index ee4ed674110..3f4962b543d 100644
--- a/app/controllers/projects/lfs_api_controller.rb
+++ b/app/controllers/projects/lfs_api_controller.rb
@@ -93,7 +93,7 @@ class Projects::LfsApiController < Projects::GitHttpClientController
end
def lfs_check_batch_operation!
- if upload_request? && Gitlab::Database.read_only?
+ if batch_operation_disallowed?
render(
json: {
message: lfs_read_only_message
@@ -105,6 +105,11 @@ class Projects::LfsApiController < Projects::GitHttpClientController
end
# Overridden in EE
+ def batch_operation_disallowed?
+ upload_request? && Gitlab::Database.read_only?
+ end
+
+ # Overridden in EE
def lfs_read_only_message
_('You cannot write to this read-only GitLab instance.')
end