BigW Consortium Gitlab

Commit 7af56500 by James Lopez

refactor code to match EE changes

parent a898714c
......@@ -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
......@@ -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
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