Commit e9a3f7fe authored by Mark Chao's avatar Mark Chao

Skip analysis if no approvals required

parent d1e96959
...@@ -40,14 +40,7 @@ class MergeRequestApproverPresenter < Gitlab::View::Presenter::Simple ...@@ -40,14 +40,7 @@ class MergeRequestApproverPresenter < Gitlab::View::Presenter::Simple
private private
def users def users
return @users if defined?(@users) @users ||= users_from_git_log_authors
load_users
@users
end
def load_users
set_users_from_git_log_authors
end end
def code_owner_enabled? def code_owner_enabled?
...@@ -56,8 +49,12 @@ class MergeRequestApproverPresenter < Gitlab::View::Presenter::Simple ...@@ -56,8 +49,12 @@ class MergeRequestApproverPresenter < Gitlab::View::Presenter::Simple
end end
end end
def set_users_from_git_log_authors def users_from_git_log_authors
@users = ::Gitlab::AuthorityAnalyzer.new(merge_request, skip_user).calculate.first(merge_request.approvals_required) if merge_request.approvals_required > 0
::Gitlab::AuthorityAnalyzer.new(merge_request, skip_user).calculate.first(merge_request.approvals_required)
else
[]
end
end end
def code_owner_loader def code_owner_loader
......
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