Properly fetch ldap groups

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