whimsical-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject [whimsy] branch master updated: Use existing method to find ICLAs
Date Fri, 29 Nov 2019 09:33:14 GMT
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 0096642  Use existing method to find ICLAs
0096642 is described below

commit 009664249ea26cd59158d260eb99500da0a3b95e
Author: Sebb <sebb@apache.org>
AuthorDate: Fri Nov 29 09:33:05 2019 +0000

    Use existing method to find ICLAs
---
 www/secretary/workbench/views/actions/icla.json.rb | 19 +++++++------------
 1 file changed, 7 insertions(+), 12 deletions(-)

diff --git a/www/secretary/workbench/views/actions/icla.json.rb b/www/secretary/workbench/views/actions/icla.json.rb
index c043a84..f778119 100644
--- a/www/secretary/workbench/views/actions/icla.json.rb
+++ b/www/secretary/workbench/views/actions/icla.json.rb
@@ -17,19 +17,14 @@ fileext = File.extname(@selected).downcase if @signature.empty?
 
 # verify that an ICLA under that name doesn't already exist
 if "#@filename#{fileext}" =~ /\w[-\w]*\.?\w*/
-  icladir = "#{ASF::SVN['iclas']}/#@filename" # first check for directory
-  if File.exist? icladir.untaint
-    _warn "documents/iclas/#@filename already exists"
+  # Is there a matching ICLA? (returns first match, if any)
+  file = ASF::ICLAFiles.match_claRef(@filename.untaint)
+  if file
+    _warn "documents/iclas/#{file} already exists"
   else
-    # now check for a file (may have various extensions)
-    file = Dir["#{icladir}.*"]
-    if file.any?
-      _warn "documents/iclas/#{File.basename(file.first)} already exists"
-    else
-      _icla = ASF::ICLA.find_by_email(@email.strip)
-      if _icla
-        _warn "Email #{@email.strip} found in iclas.txt file - #{_icla.as_line}"
-      end
+    _icla = ASF::ICLA.find_by_email(@email.strip)
+    if _icla
+      _warn "Email #{@email.strip} found in iclas.txt file - #{_icla.as_line}"
     end
   end
 else


Mime
View raw message