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 2021/07/31 21:54:19 UTC

[whimsy] branch master updated: Look for additional matches of first/last names

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 a28206d  Look for additional matches of first/last names
a28206d is described below

commit a28206d9102a9a101373f881212394ec78272acb
Author: Sebb <se...@apache.org>
AuthorDate: Sat Jul 31 22:54:10 2021 +0100

    Look for additional matches of first/last names
---
 www/secretary/icla-dupes.cgi | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/www/secretary/icla-dupes.cgi b/www/secretary/icla-dupes.cgi
index 3db7375..da83f70 100755
--- a/www/secretary/icla-dupes.cgi
+++ b/www/secretary/icla-dupes.cgi
@@ -28,9 +28,19 @@ _html do
 
   dups = Hash.new{|h,k| h[k]=Array.new}
   ASF::ICLA.each do |icla|
-    legal=icla.legal_name
-    key = legal.split(' ').sort.join(' ')
+    legal = icla.legal_name
+    legals = legal.downcase.split(' ')
+    if %w(jr jr. ii iii).include? legals[-1]
+      legals.pop
+    end
+    key = legals.sort.join(' ')
     dups[key] << {legal: legal, public: icla.name,  email: icla.email, claRef: icla.claRef, id: icla.id}
+    if legals.size > 2 # try only first and last names
+      key2 = [legals[0], legals[-1]].sort.join(' ')
+      # Store main key so can drop ones already shown later
+      # e.g. if A B C and C B A already have appeared, no point showing A C and C A
+      dups[key2] << {key: key, legal: legal, public: icla.name,  email: icla.email, claRef: icla.claRef, id: icla.id}
+    end
   end
 
   _table do
@@ -43,6 +53,8 @@ _html do
       _th 'CLAref'
     end
     dups.sort_by{|k,v| k}.each do |key, val|
+      # look for repeats of A B C / C B A
+      next if val.size == 2 and (val[0][:key] || '1' ) == (val[1][:key] || '2')
       if val.size > 1
         _tr do
           _td key