You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@whimsical.apache.org by Sam Ruby <ru...@apache.org> on 2016/02/16 23:46:46 UTC

[whimsy.git] [1/1] Commit ab196b5: error checking

Commit ab196b53296e95331f7f3368f2e2d79173ee0aa2:
    error checking


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

------------------------------------------------------------
www/roster/main.rb                                           | ++++++++++ 
www/roster/models/committee.rb                               | + 
www/roster/models/committer.rb                               | + 
------------------------------------------------------------
12 changes: 12 additions, 0 deletions.
------------------------------------------------------------


diff --git a/www/roster/main.rb b/www/roster/main.rb
index 21747b1..f27f0d8 100755
--- a/www/roster/main.rb
+++ b/www/roster/main.rb
@@ -28,12 +28,20 @@
   _html :committers
 end
 
+get '/committer' do
+  call env.merge('PATH_INFO' => '/committer/')
+end
+
 get '/committee/' do
   @members = ASF::Member.list.keys
   @committees = ASF::Committee.list
   _html :committees
 end
 
+get '/committee' do
+  call env.merge('PATH_INFO' => '/committee/')
+end
+
 get '/committer/index.json' do
   # bulk loading the mail information makes things go faster
   mail = Hash[ASF::Mail.list.group_by(&:last).
@@ -54,6 +62,7 @@
 get '/committee/:name' do |name|
   @auth = Auth.info(env)
   @committee = Committee.serialize(name)
+  pass unless @committee
   _html :committee
 end
 
@@ -63,6 +72,7 @@
 
 get '/committer/:name' do |name|
   @committer = Committer.serialize(name)
+  pass unless @committer
   _html :committer
 end
 
diff --git a/www/roster/models/committee.rb b/www/roster/models/committee.rb
index c5b5f30..9451b11 100644
--- a/www/roster/models/committee.rb
+++ b/www/roster/models/committee.rb
@@ -4,6 +4,7 @@ def self.serialize(id)
 
     pmc = ASF::Committee.find(id)
     committers = ASF::Group.find(id).members
+    return if pmc.members.empty? and committers.empty?
 
     ASF::Committee.load_committee_info
     people = ASF::Person.preload('cn', (pmc.members + committers).uniq)
diff --git a/www/roster/models/committer.rb b/www/roster/models/committer.rb
index 6430991..5df960d 100644
--- a/www/roster/models/committer.rb
+++ b/www/roster/models/committer.rb
@@ -3,6 +3,7 @@ def self.serialize(id)
     response = {}
 
     person = ASF::Person.find(id)
+    return unless person.attrs['cn']
 
     response[:id] = id