Do not blow up when Rails.configuration.Users.UserProfileNotificationAddress is 15286-defaults-fix
authorWard Vandewege <wvandewege@veritasgenetics.com>
Mon, 3 Jun 2019 19:14:37 +0000 (15:14 -0400)
committerWard Vandewege <wvandewege@veritasgenetics.com>
Mon, 3 Jun 2019 19:25:25 +0000 (15:25 -0400)
set to the empty string, which is the default since #13996 (it defaulted to a
dummy e-mail adress before).

refs #15286
refs #13996

Arvados-DCO-1.1-Signed-off-by: Ward Vandewege <wvandewege@veritasgenetics.com>

services/api/app/models/user.rb

index 989a975924c1bedaa143b75fea3ca830157118d2..fc5ae0a49db5b2fb05036a0587759d92378358cf 100644 (file)
@@ -580,7 +580,7 @@ class User < ArvadosModel
     if self.prefs_changed?
       if self.prefs_was.andand.empty? || !self.prefs_was.andand['profile']
         profile_notification_address = Rails.configuration.Users.UserProfileNotificationAddress
-        ProfileNotifier.profile_created(self, profile_notification_address).deliver_now if profile_notification_address
+        ProfileNotifier.profile_created(self, profile_notification_address).deliver_now if profile_notification_address and !profile_notification_address.empty?
       end
     end
   end