You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@whimsical.apache.org by se...@apache.org on 2019/02/01 11:13:49 UTC

[whimsy] branch master updated: We always have a committers group now

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 e42d3cb  We always have a committers group now
e42d3cb is described below

commit e42d3cb8ca4458b8ba77dc5f53b5c431c4462016
Author: Sebb <se...@apache.org>
AuthorDate: Fri Feb 1 11:13:41 2019 +0000

    We always have a committers group now
    
    It so happens that the previoud code behaved identically,
    because ASF::Group.find() always returns an object.
    It was possibly supposed to use ASF::Group[], but that would
    only have worked for non-guineapigs
---
 www/roster/views/actions/committee.json.rb | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/www/roster/views/actions/committee.json.rb b/www/roster/views/actions/committee.json.rb
index b69031a..216bfc9 100644
--- a/www/roster/views/actions/committee.json.rb
+++ b/www/roster/views/actions/committee.json.rb
@@ -1,6 +1,5 @@
 if env.password
   pmc = ASF::Committee[@project]
-  group = ASF::Group.find(@project) if @targets.include? 'commit'
 
   # validate arguments
   if @action == 'remove' 
@@ -20,10 +19,10 @@ if env.password
     ASF::LDAP.bind(env.user, env.password) do
       if @action == 'add'
         pmc.add_owners(people) if @targets.include? 'pmc'
-        pmc.add_committers(people) if group
+        pmc.add_committers(people) if @targets.include? 'commit'
       elsif @action == 'remove'
         pmc.remove_owners(people) if @targets.include? 'pmc'
-        pmc.remove_committers(people) if group
+        pmc.remove_committers(people) if @targets.include? 'commit'
       end
     end
   end
@@ -98,7 +97,7 @@ if env.password
   # compose E-mail
   action = (@action == 'add' ? 'added to' : 'removed from')
   if @targets.include? 'pmc'
-    list = group ? 'PMC and committers list' : 'PMC list'
+    list = @targets.include? 'commit' ? 'PMC and committers list' : 'PMC list'
   elsif @targets.include? 'info'
     list = 'in committee-info.txt'
   else
@@ -107,7 +106,7 @@ if env.password
 
   details = people.map {|person| person.dn}
   details << "#{pmc.dn};attr=owner" if @targets.include? 'pmc'
-  details << "#{pmc.dn};attr=member" if group
+  details << "#{pmc.dn};attr=member" if @targets.include? 'commit'
 
   cc = people.map do |person| 
     "#{person.public_name.inspect} <#{...@apache.org>".untaint