refactor code to match EE changes
This commit is contained in:
parent
a898714c7f
commit
7af56500a1
2 changed files with 10 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue