refactor code to match EE changes

This commit is contained in:
James Lopez 2017-12-07 17:13:40 +01:00
parent a898714c7f
commit 7af56500a1
2 changed files with 10 additions and 2 deletions

View File

@ -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

View File

@ -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