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 3ce4ab1  Parameterise reasons to make changes easier
3ce4ab1 is described below

commit 3ce4ab1b3de57156323cf21a8fbad0788592155d
Author: Sebb <[email protected]>
AuthorDate: Sat Feb 19 13:01:41 2022 +0000

    Parameterise reasons to make changes easier
---
 www/secretary/workbench/views/actions/incomplete.json.rb | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/www/secretary/workbench/views/actions/incomplete.json.rb 
b/www/secretary/workbench/views/actions/incomplete.json.rb
index de62701..381a376 100644
--- a/www/secretary/workbench/views/actions/incomplete.json.rb
+++ b/www/secretary/workbench/views/actions/incomplete.json.rb
@@ -11,13 +11,19 @@ _extract_project
 #                           email submitter                            #
 ########################################################################
 
+REASONS = {
+  '@missing_address' => 'missing or incomplete postal address',
+  '@missing_email' => 'missing email address',
+}
+
 # send rejection email
 task "email #{message.from}" do
   # build mail from template
   @email = message.from
   missing_items = []
-  missing_items << '- missing or incomplete postal address' if 
@missing_address == 'true'
-  missing_items << '- missing email address' if @missing_email == 'true'
+  REASONS.each do |k, v|
+    missing_items << "- #{v}" if instance_variable_get(k) == 'true'
+  end
   missing_items << '' if missing_items.size > 0 # add separator
   @missing_items = missing_items.join("\n")
   mail = message.reply(

Reply via email to