[ARVADOS] updated: a39032f95b14448950792600cf27aa67a582674c

git at public.curoverse.com git at public.curoverse.com
Sat Aug 23 13:21:47 EDT 2014


Summary of changes:
 services/api/app/mailers/admin_notifier.rb |  4 ++--
 services/api/test/unit/user_test.rb        | 12 +++++++-----
 2 files changed, 9 insertions(+), 7 deletions(-)

       via  a39032f95b14448950792600cf27aa67a582674c (commit)
      from  523627b6ac01c84afbc7b08976f76820a71c4d37 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit a39032f95b14448950792600cf27aa67a582674c
Author: radhika <radhika at curoverse.com>
Date:   Sat Aug 23 13:19:39 2014 -0400

    3153: when new_users_are_active config param is set, even blacklisted users will be "active", and hence the email notification would say the user is setup when auto_setup_new_users is set.

diff --git a/services/api/app/mailers/admin_notifier.rb b/services/api/app/mailers/admin_notifier.rb
index 035072b..d86a281 100644
--- a/services/api/app/mailers/admin_notifier.rb
+++ b/services/api/app/mailers/admin_notifier.rb
@@ -12,11 +12,11 @@ class AdminNotifier < ActionMailer::Base
 
       add_to_subject = ''
       if Rails.configuration.auto_setup_new_users
-        add_to_subject = @user.is_invited ? 'and setup' : ', but not setup'
+        add_to_subject = @user.is_invited ? 'and setup ' : ', but not setup '
       end
 
       mail(to: @recipients,
-           subject: "#{Rails.configuration.email_subject_prefix}New user created #{add_to_subject} notification"
+           subject: "#{Rails.configuration.email_subject_prefix}New user created #{add_to_subject}notification"
           )
     end
   end
diff --git a/services/api/test/unit/user_test.rb b/services/api/test/unit/user_test.rb
index 7de3fae..d93d8ae 100644
--- a/services/api/test/unit/user_test.rb
+++ b/services/api/test/unit/user_test.rb
@@ -145,8 +145,9 @@ class UserTest < ActiveSupport::TestCase
     [false, [], [], 'arvados', false, false, true],   # since we are not creating repo and vm login, this blacklisted name is not a problem
 
     [false, [], [], 'arvados at example.com', false, false, true],   # since we are not creating repo and vm login, this blacklisted name is not a problem
-    [true, 'active-notify at example.com', 'inactive-notify at example.com', 'arvados at ex.com', false, false, true],   # since we are not creating repo and vm login, this blacklisted name is not a problem
-    [true, 'active-notify at example.com', 'inactive-notify at example.com', 'root at example.com', true, false, false], # blacklisted name after removing -._ characters
+    [true, 'active-notify at example.com', 'inactive-notify at example.com', 'arvados at example.com', false, false, true],   # since we are not creating repo and vm login, this blacklisted name is not a problem
+    [true, 'active-notify at example.com', 'inactive-notify at example.com', 'root at example.com', true, false, false], # blacklisted name
+    [false, 'active-notify at example.com', 'inactive-notify at example.com', 'root at example.com', true, false, false], # blacklisted name
     [true, 'active-notify at example.com', 'inactive-notify at example.com', 'roo_t at example.com', false, true, true], # not blacklisted name
 
     [false, [], [], '@example.com', true, false, false],  # incorrect format
@@ -524,8 +525,9 @@ class UserTest < ActiveSupport::TestCase
 
     new_user_email_subject = "#{Rails.configuration.email_subject_prefix}New user created notification"
     if Rails.configuration.auto_setup_new_users
-      new_user_email_subject = ok_to_auto_setup ? "#{Rails.configuration.email_subject_prefix}New user created and setup notification" :
-                                                "#{Rails.configuration.email_subject_prefix}New user created, but not setup notification"
+      new_user_email_subject = (ok_to_auto_setup || active) ?
+                                 "#{Rails.configuration.email_subject_prefix}New user created and setup notification" :
+                                 "#{Rails.configuration.email_subject_prefix}New user created, but not setup notification"
     end
 
     ActionMailer::Base.deliveries.each do |d|
@@ -549,7 +551,7 @@ class UserTest < ActiveSupport::TestCase
 
     if active
       assert_nil new_inactive_user_email, 'Expected no inactive user email after setting up active user'
-      if (not active_recipients.empty?) && ok_to_auto_setup then
+      if not active_recipients.empty? then
         assert_not_nil new_user_email, 'Expected new user email after setup'
         assert_equal Rails.configuration.user_notifier_email_from, new_user_email.from[0]
         assert_equal active_recipients, new_user_email.to[0]

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list