BigW Consortium Gitlab

Commit 7af56500 by James Lopez

refactor code to match EE changes

parent a898714c
...@@ -166,7 +166,7 @@ module Gitlab ...@@ -166,7 +166,7 @@ module Gitlab
end end
if Gitlab::Database.read_only? if Gitlab::Database.read_only?
raise UnauthorizedError, ERROR_MESSAGES[:cannot_push_to_read_only] raise UnauthorizedError, push_to_read_only_message
end end
if deploy_key if deploy_key
...@@ -280,5 +280,9 @@ module Gitlab ...@@ -280,5 +280,9 @@ module Gitlab
UserAccess.new(user, project: project) UserAccess.new(user, project: project)
end end
end end
def push_to_read_only_message
ERROR_MESSAGES[:cannot_push_to_read_only]
end
end end
end end
...@@ -19,10 +19,14 @@ module Gitlab ...@@ -19,10 +19,14 @@ module Gitlab
end end
if Gitlab::Database.read_only? if Gitlab::Database.read_only?
raise UnauthorizedError, ERROR_MESSAGES[:read_only] raise UnauthorizedError, push_to_read_only_message
end end
true true
end end
def push_to_read_only_message
ERROR_MESSAGES[:read_only]
end
end end
end end
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