whimsical-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ru...@apache.org
Subject [whimsy] branch master updated: pmc needs to always be set
Date Thu, 08 Jun 2017 02:17:39 GMT
This is an automated email from the ASF dual-hosted git repository.

rubys 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 ddc0375  pmc needs to always be set
ddc0375 is described below

commit ddc03752dc3e895d9aa12d26d495bbd17f8be6c6
Author: Sam Ruby <rubys@intertwingly.net>
AuthorDate: Wed Jun 7 22:17:23 2017 -0400

    pmc needs to always be set
---
 www/roster/views/actions/committee.json.rb | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/www/roster/views/actions/committee.json.rb b/www/roster/views/actions/committee.json.rb
index 4973c00..d12101e 100644
--- a/www/roster/views/actions/committee.json.rb
+++ b/www/roster/views/actions/committee.json.rb
@@ -1,16 +1,16 @@
 if env.password
   people = @ids.split(',').map {|id| ASF::Person.find(id)}
-  pmc = ASF::Committee.find(@project) if @targets.include? 'pmc'
+  pmc = ASF::Committee.find(@project)
   group = ASF::Group.find(@project) if @targets.include? 'commit'
 
   # update LDAP
   if @targets.include? 'pmc' or @targets.include? 'commit'
     ASF::LDAP.bind(env.user, env.password) do
       if @action == 'add'
-        pmc.add_owners(people) if pmc
+        pmc.add_owners(people) if @targets.include? 'pmc'
         pmc.add_committers(people) if group
       elsif @action == 'remove'
-        pmc.remove_owners(people) if pmc
+        pmc.remove_owners(people) if @targets.include? 'pmc'
         pmc.remove_committers(people) if group
       end
     end
@@ -85,7 +85,7 @@ if env.password
 
   # compose E-mail
   action = (@action == 'add' ? 'added to' : 'removed from')
-  if pmc
+  if @targets.include? 'pmc'
     list = group ? 'PMC and committers list' : 'PMC list'
   elsif @targets.include? 'info'
     list = 'in committee-info.txt'
@@ -95,14 +95,13 @@ if env.password
 
   details = people.map {|person| person.dn}
   if pmc.id == 'incubator'
-    details << "#{pmc.dn};attr=owner" if pmc
+    details << "#{pmc.dn};attr=owner" if @targets.include? 'pmc'
     details << "#{pmc.dn};attr=member" if group
   else
-    details << pmc.dn if pmc
+    details << pmc.dn if @targets.include? 'pmc'
     details << group.dn if group
   end
 
-  pmc ||= ASF::Committee.find(@project)
   from = ASF::Person.find(env.user)
 
   # identify what has changed

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

Mime
View raw message