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/03/11 23:57:18 UTC

[whimsy] branch master updated: Wrong fix. pmc? and nonpmc? can both be false

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 c063347  Wrong fix. pmc? and nonpmc? can both be false
c063347 is described below

commit c0633473c5d4b6ef90e1575f24f2a897bf933a97
Author: Sebb <se...@apache.org>
AuthorDate: Mon Mar 11 23:57:09 2019 +0000

    Wrong fix. pmc? and nonpmc? can both be false
    
    Use positive assertion to exclude this
---
 lib/whimsy/asf/committee.rb         | 4 ++--
 www/roster/models/committee.rb      | 2 +-
 www/roster/public_committee_info.rb | 2 +-
 www/roster/public_ldap_projects.rb  | 2 +-
 4 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/lib/whimsy/asf/committee.rb b/lib/whimsy/asf/committee.rb
index 01ec4e4..4247480 100644
--- a/lib/whimsy/asf/committee.rb
+++ b/lib/whimsy/asf/committee.rb
@@ -524,8 +524,8 @@ module ASF
     # if true, this committee is not a PMC.  
     # Data is obtained from <tt>committee-info.txt</tt>.
     def nonpmc?
-      # cannot use Committee.nonpmcs.include? self because self may not be a proper Committee
-      ! pmc?
+      Committee.load_committee_info # ensure data is there
+      Committee.nonpmcs.include? self
     end
 
     # if true, this committee is a PMC.  
diff --git a/www/roster/models/committee.rb b/www/roster/models/committee.rb
index 1907daa..6798e07 100644
--- a/www/roster/models/committee.rb
+++ b/www/roster/models/committee.rb
@@ -3,7 +3,7 @@ class Committee
     response = {}
 
     pmc = ASF::Committee.find(id)
-    return if pmc.nonpmc? # Only show PMCs
+    return unless pmc.pmc? # Only show PMCs
     members = pmc.owners
     committers = pmc.committers
     return if members.empty? and committers.empty?
diff --git a/www/roster/public_committee_info.rb b/www/roster/public_committee_info.rb
index b9dcad3..78668eb 100644
--- a/www/roster/public_committee_info.rb
+++ b/www/roster/public_committee_info.rb
@@ -54,7 +54,7 @@ info[:committees] = Hash[committees.map {|committee|
     chair: Hash[committee.chairs.map {|chair|
       [chair[:id], {:name => chair[:name]} ]}],
     roster: committee.roster.sort.to_h, # sort entries by uid
-    pmc: !committee.nonpmc?
+    pmc: committee.pmc?
   }]
 }]
 
diff --git a/www/roster/public_ldap_projects.rb b/www/roster/public_ldap_projects.rb
index 976386c..007fd52 100644
--- a/www/roster/public_ldap_projects.rb
+++ b/www/roster/public_ldap_projects.rb
@@ -39,7 +39,7 @@ end
 
 # committee status
 committees = Hash[ASF::Committee.load_committee_info.map {|committee|
-  [ committee.name.gsub(/[^-\w]/,'') , !committee.nonpmc? ]
+  [ committee.name.gsub(/[^-\w]/,'') , committee.pmc? ]
 }]
 
 # podling status