whimsical-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject [whimsy] branch master updated: Attributes are expected to be arrays, not strings
Date Sat, 19 Jun 2021 20:18:59 GMT
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 47e55ca  Attributes are expected to be arrays, not strings
47e55ca is described below

commit 47e55ca6c43e0d17943a057e1e65edd286ac147e
Author: Sebb <sebb@apache.org>
AuthorDate: Sat Jun 19 21:18:50 2021 +0100

    Attributes are expected to be arrays, not strings
---
 lib/whimsy/asf/ldap.rb | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lib/whimsy/asf/ldap.rb b/lib/whimsy/asf/ldap.rb
index c95f68c..f01f05d 100644
--- a/lib/whimsy/asf/ldap.rb
+++ b/lib/whimsy/asf/ldap.rb
@@ -902,8 +902,10 @@ module ASF
     # update an LDAP attribute for this person.  This needs to be run
     # either inside or after ASF::LDAP.bind.
     def modify(attr, value)
+      value = Array(value) 
       ASF::LDAP.modify(self.dn, [ASF::Base.mod_replace(attr.to_s, value)])
-      attrs[attr.to_s] = value
+      # attributes are expected to be arrays
+      attrs[attr.to_s] = value.is_a?(String) ? [value] : value
     end
 
     # add a new person to LDAP.  Attrs must include uid, cn, and mail

Mime
View raw message