Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2018-07-03 18:46:23 +0300
committerDouwe Maan <douwe@gitlab.com>2018-07-03 18:46:23 +0300
commitf3e95aae7abb68f86fc614d70d0ec4b9683b7bfb (patch)
tree8df1a102872fda5e4d9f651e5482f397ab92ca50 /app/controllers/projects
parentf30089075fabfbac45c6382c0a2717bbb682734e (diff)
parentacc6e3a0fdb8f710d77b8faa2a39823f7e1c7e5d (diff)
Merge branch 'master' into 'web-hooks-log-pagination'
# Conflicts: # db/schema.rb
Diffstat (limited to 'app/controllers/projects')
-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