Properly fetch ldap groups

parent 9b678226
......@@ -137,8 +137,7 @@ module Gitlab
end
def ldap_groups
@ldap_groups ||= ::LdapGroupLink.with_provider(provider)
distinct(:cn).pluck(:cn).map do |cn|
@ldap_groups ||= ::LdapGroupLink.with_provider(provider).distinct(:cn).pluck(:cn).map do |cn|
Gitlab::LDAP::Group.find_by_cn(cn, adapter)
end.compact
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