From bca9a8431e0478dfe9ebdc979ac3ad366f59e5aa Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Mon, 11 Mar 2013 17:50:18 +0000 Subject: [PATCH] Mail handler: set mail_notification to only_my_events when creating a new user (#13341). git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11590 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/models/mail_handler.rb | 1 + test/unit/mail_handler_test.rb | 1 + 2 files changed, 2 insertions(+) diff --git a/app/models/mail_handler.rb b/app/models/mail_handler.rb index edbbe406b..c827f26f2 100644 --- a/app/models/mail_handler.rb +++ b/app/models/mail_handler.rb @@ -436,6 +436,7 @@ class MailHandler < ActionMailer::Base user.lastname = '-' if user.lastname.blank? user.language = Setting.default_language user.generate_password = true + user.mail_notification = 'only_my_events' unless user.valid? user.login = "user#{Redmine::Utils.random_hex(6)}" unless user.errors[:login].blank? diff --git a/test/unit/mail_handler_test.rb b/test/unit/mail_handler_test.rb index 2b5b3f070..b345683fe 100644 --- a/test/unit/mail_handler_test.rb +++ b/test/unit/mail_handler_test.rb @@ -768,6 +768,7 @@ class MailHandlerTest < ActiveSupport::TestCase assert_equal expected[0], user.login assert_equal expected[1], user.firstname assert_equal expected[2], user.lastname + assert_equal 'only_my_events', user.mail_notification end end