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
This commit is contained in:
Jean-Philippe Lang 2013-03-11 17:50:18 +00:00
parent 7cecd72faa
commit bca9a8431e
2 changed files with 2 additions and 0 deletions

View File

@ -436,6 +436,7 @@ class MailHandler < ActionMailer::Base
user.lastname = '-' if user.lastname.blank? user.lastname = '-' if user.lastname.blank?
user.language = Setting.default_language user.language = Setting.default_language
user.generate_password = true user.generate_password = true
user.mail_notification = 'only_my_events'
unless user.valid? unless user.valid?
user.login = "user#{Redmine::Utils.random_hex(6)}" unless user.errors[:login].blank? user.login = "user#{Redmine::Utils.random_hex(6)}" unless user.errors[:login].blank?

View File

@ -768,6 +768,7 @@ class MailHandlerTest < ActiveSupport::TestCase
assert_equal expected[0], user.login assert_equal expected[0], user.login
assert_equal expected[1], user.firstname assert_equal expected[1], user.firstname
assert_equal expected[2], user.lastname assert_equal expected[2], user.lastname
assert_equal 'only_my_events', user.mail_notification
end end
end end