[whimsy] branch master updated: check for empty list just in case

2017-12-15 Thread sebb
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 5e99628  check for empty list just in case
5e99628 is described below

commit 5e99628962852cab88283849d0a06c44f29e4bfa
Author: Sebb 
AuthorDate: Fri Dec 15 13:53:39 2017 +

check for empty list just in case
---
 www/roster/views/actions/committee.json.rb | 3 +++
 www/roster/views/actions/ppmc.json.rb  | 3 +++
 2 files changed, 6 insertions(+)

diff --git a/www/roster/views/actions/committee.json.rb 
b/www/roster/views/actions/committee.json.rb
index e2b6664..f93ff3e 100644
--- a/www/roster/views/actions/committee.json.rb
+++ b/www/roster/views/actions/committee.json.rb
@@ -10,6 +10,9 @@ if env.password
 raise ArgumentError.new("ids=#{@ids}") if people.any? {|person| 
person.nil?}
   end
 
+  # Don't allow empty list
+  raise ArgumentError.new("ids='#{@ids}'") unless people.length > 0
+
   raise ArgumentError.new("project=#{@project}") unless pmc
 
   # update LDAP
diff --git a/www/roster/views/actions/ppmc.json.rb 
b/www/roster/views/actions/ppmc.json.rb
index fb476e5..b7ba05e 100644
--- a/www/roster/views/actions/ppmc.json.rb
+++ b/www/roster/views/actions/ppmc.json.rb
@@ -8,6 +8,9 @@ if env.password
 raise ArgumentError.new("ids=#{@ids}") if people.any? {|person| 
person.nil?}
   end
 
+  # Don't allow empty list
+  raise ArgumentError.new("ids='#{@ids}'") unless people.length > 0
+
   # if target is ONLY icommit, use incubator in the email message, etc.
   # Otherwise, use the project (podling).
   if @targets == ['icommit']

-- 
To stop receiving notification emails like this one, please contact
['"commits@whimsical.apache.org" '].


[whimsy] branch master updated: Simplify id validation - copy code from committee

2017-12-15 Thread sebb
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 beab937  Simplify id validation - copy code from committee
beab937 is described below

commit beab9374c9267dca7e48eaefcc9b32eb9ec84eb8
Author: Sebb 
AuthorDate: Fri Dec 15 13:37:15 2017 +

Simplify id validation - copy code from committee
---
 www/roster/views/actions/ppmc.json.rb | 15 ---
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/www/roster/views/actions/ppmc.json.rb 
b/www/roster/views/actions/ppmc.json.rb
index 0f29252..fb476e5 100644
--- a/www/roster/views/actions/ppmc.json.rb
+++ b/www/roster/views/actions/ppmc.json.rb
@@ -1,6 +1,12 @@
 if env.password
-  # Allow for missing people
-  people = @ids.split(',').map {|id| ASF::Person[id] || ASF::Person.find(id) }
+
+  # validate ids
+  if @action == 'remove' 
+people = @ids.split(',').map {|id| ASF::Person.find(id)}
+  else
+people = @ids.split(',').map {|id| ASF::Person[id]}
+raise ArgumentError.new("ids=#{@ids}") if people.any? {|person| 
person.nil?}
+  end
 
   # if target is ONLY icommit, use incubator in the email message, etc.
   # Otherwise, use the project (podling).
@@ -10,11 +16,6 @@ if env.password
 project = ASF::Project[@project]
   end
 
-  # validate arguments (dn attribute is only present for real people)
-  if @action != 'remove' and people.any? {|person| person.attrs['dn'].nil?}
-raise ArgumentError.new("ids=#{@ids}") 
-  end
-
   unless @action == 'add' and @targets.include? 'ldap'
 raise ArgumentError.new("project=#{@project}") unless project
   end

-- 
To stop receiving notification emails like this one, please contact
['"commits@whimsical.apache.org" '].


[whimsy] branch master updated: This will be redone later

2017-12-15 Thread sebb
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 6d702f7  This will be redone later
6d702f7 is described below

commit 6d702f7a78cf51d6842ec8b8a27ca0c43a60be52
Author: Sebb 
AuthorDate: Fri Dec 15 13:25:24 2017 +

This will be redone later
---
 www/roster/views/actions/committee.json.rb | 2 --
 1 file changed, 2 deletions(-)

diff --git a/www/roster/views/actions/committee.json.rb 
b/www/roster/views/actions/committee.json.rb
index 64b1bde..e2b6664 100644
--- a/www/roster/views/actions/committee.json.rb
+++ b/www/roster/views/actions/committee.json.rb
@@ -1,6 +1,4 @@
 if env.password
-  people = @ids.split(',').map {|id| ASF::Person.find(id)}
-
   pmc = ASF::Committee[@project]
   group = ASF::Group.find(@project) if @targets.include? 'commit'
 

-- 
To stop receiving notification emails like this one, please contact
['"commits@whimsical.apache.org" '].