summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2017-12-07 17:43:05 +0000
committerDouwe Maan <douwe@gitlab.com>2017-12-07 17:43:05 +0000
commit989d3148e1a274fb6baf1d90f28dcfaa331a57b0 (patch)
tree39fd7de83fe117a63325cf11a3926024fc2667c2
parent980ea20cc91fa5feee0f633526b14aa59c354fb1 (diff)
parent7af56500a1e1b6437a2fa27988a5f11a4eb54391 (diff)
downloadgitlab-ce-989d3148e1a274fb6baf1d90f28dcfaa331a57b0.tar.gz
Merge branch 'fix/push-read-only-message-ce' into 'master'
[CE] Fix message when pushing to Geo secondary See merge request gitlab-org/gitlab-ce!15793
-rw-r--r--lib/gitlab/git_access.rb6
-rw-r--r--lib/gitlab/git_access_wiki.rb6
2 files changed, 10 insertions, 2 deletions
diff --git a/lib/gitlab/git_access.rb b/lib/gitlab/git_access.rb
index 8998c4b1a83..9d7d921bb9c 100644
--- a/lib/gitlab/git_access.rb
+++ b/lib/gitlab/git_access.rb
@@ -166,7 +166,7 @@ module Gitlab
end
if Gitlab::Database.read_only?
- raise UnauthorizedError, ERROR_MESSAGES[:cannot_push_to_read_only]
+ raise UnauthorizedError, push_to_read_only_message
end
if deploy_key
@@ -280,5 +280,9 @@ module Gitlab
UserAccess.new(user, project: project)
end
end
+
+ def push_to_read_only_message
+ ERROR_MESSAGES[:cannot_push_to_read_only]
+ end
end
end
diff --git a/lib/gitlab/git_access_wiki.rb b/lib/gitlab/git_access_wiki.rb
index 98f1f45b338..1c9477e84b2 100644
--- a/lib/gitlab/git_access_wiki.rb
+++ b/lib/gitlab/git_access_wiki.rb
@@ -19,10 +19,14 @@ module Gitlab
end
if Gitlab::Database.read_only?
- raise UnauthorizedError, ERROR_MESSAGES[:read_only]
+ raise UnauthorizedError, push_to_read_only_message
end
true
end
+
+ def push_to_read_only_message
+ ERROR_MESSAGES[:read_only]
+ end
end
end