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: Hack to allow editting of multiple entries
Date Fri, 22 Mar 2019 20:18:47 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 2a5e278  Hack to allow editting of multiple entries
2a5e278 is described below

commit 2a5e278e38d124b4e0ebb1b358630a74fb2cc358
Author: Sebb <sebb@apache.org>
AuthorDate: Fri Mar 22 20:18:44 2019 +0000

    Hack to allow editting of multiple entries
    
    Try again, but disallow duplicates
---
 www/roster/views/actions/github.json.rb | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/www/roster/views/actions/github.json.rb b/www/roster/views/actions/github.json.rb
index 559d962..8a4b0f8 100644
--- a/www/roster/views/actions/github.json.rb
+++ b/www/roster/views/actions/github.json.rb
@@ -10,7 +10,10 @@ _ldap.update do
   _previous githubUsername: person.attrs['githubUsername']
 
   if @githubuser and not @dryrun
-    person.modify 'githubUsername', @githubuser
+    # TODO: Hack to deal with single input field on the form
+    # multiple entries are currently displayed with commas when editting
+    names = @githubuser.split(/[, ]+/).uniq{|n| n.downcase} # duplicates not allowed; case-blind
+    person.modify 'githubUsername', names
   end
 end
 


Mime
View raw message