This is an automated email from the ASF dual-hosted git repository.
sebb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/whimsy.git
The following commit(s) were added to refs/heads/master by this push:
new 68ff497 Safer to check dn rather than empty member attribute
68ff497 is described below
commit 68ff497bc89a780085e36afdb54f553ab115df8c
Author: Sebb <[email protected]>
AuthorDate: Sat Jun 1 15:00:43 2019 +0100
Safer to check dn rather than empty member attribute
---
lib/whimsy/asf/ldap.rb | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/lib/whimsy/asf/ldap.rb b/lib/whimsy/asf/ldap.rb
index b455a91..e269700 100644
--- a/lib/whimsy/asf/ldap.rb
+++ b/lib/whimsy/asf/ldap.rb
@@ -1020,7 +1020,7 @@ module ASF
# return group only if it actually exits
def self.[] name
group = super
- group.members.empty? ? nil : group
+ group.dn ? group : nil
end
# setter for members, should only be used by #preload
@@ -1046,7 +1046,7 @@ module ASF
# Designated Name from LDAP
def dn
- @dn ||= ASF.search_one(base, "cn=#{name}", 'dn').first.first
+ @dn ||= ASF.search_one(base, "cn=#{name}", 'dn').first.first rescue nil
end
# remove people from an existing group in LDAP
@@ -1110,7 +1110,7 @@ module ASF
# return project only if it actually exits
def self.[] name
project = super
- project.members.empty? ? nil : project
+ project.dn ? project : nil
end
# fetch <tt>dn</tt>, <tt>member</tt>, <tt>modifyTimestamp</tt>, and