whimsical-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sam Ruby <ru...@apache.org>
Subject [whimsy.git] [1/1] Commit c90b911: exclude inactive members; fix off-by-one error
Date Mon, 22 Feb 2016 21:15:11 GMT
Commit c90b911214917e708dd395368650a5ba27310ea7:
    exclude inactive members; fix off-by-one error


Branch: refs/heads/master
Author: Sam Ruby <rubys@intertwingly.net>
Committer: Sam Ruby <rubys@intertwingly.net>
Pusher: rubys <rubys@apache.org>

------------------------------------------------------------
www/members/non-participants.cgi                             | ++++ ----
------------------------------------------------------------
8 changes: 4 additions, 4 deletions.
------------------------------------------------------------


diff --git a/www/members/non-participants.cgi b/www/members/non-participants.cgi
index 9d9497e..fbfee79 100755
--- a/www/members/non-participants.cgi
+++ b/www/members/non-participants.cgi
@@ -19,14 +19,14 @@ dates = attendance['dates'].sort.
 
 # compute mappings of names to ids
 members = ASF::Member.list
-active = members.select {|id, data| not data['status']}
+active = Hash[members.select {|id, data| not data['status']}]
 nameMap = Hash[members.map {|id, data| [id, data[:name]]}]
 idMap = Hash[nameMap.to_a.map(&:reverse)]
 
 # analyze attendance
 matrix = attendance['matrix'].map do |name, meetings|
   id = idMap[name]
-  next unless id
+  next unless id and active[id]
   data = meetings.sort.reverse.map(&:last)
   missed = (data.index {|datum| datum != '-'} || data.length)
  
@@ -81,8 +81,8 @@ end
 
 _json do
   meetingsMissed = (@meetingsMissed || 5).to_i
-  inactive = matrix.select {|id, name, missed| id and missed > meetingsMissed}
+  inactive = matrix.select {|id, name, missed| id and missed >= meetingsMissed}
   Hash[inactive.map {|id, name, missed| 
-    [id, {name: name, missed: missed-1, status: 'no response yet'}]
+    [id, {name: name, missed: missed, status: 'no response yet'}]
   }]
 end

Mime
View raw message