mirror of
https://github.com/meineerde/redmine.git
synced 2026-01-22 15:22:58 +00:00
Selected projects in email notifications on "my account" are lost when the page is redisplayed after a validation error (#18060).
Patch by Felix Schäfer. git-svn-id: http://svn.redmine.org/redmine/trunk@13638 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
4e69edb5b8
commit
827ab38725
@ -368,7 +368,7 @@ class User < Principal
|
|||||||
|
|
||||||
def notified_project_ids=(ids)
|
def notified_project_ids=(ids)
|
||||||
@notified_projects_ids_changed = true
|
@notified_projects_ids_changed = true
|
||||||
@notified_projects_ids = ids
|
@notified_projects_ids = ids.map(&:to_i).uniq.select {|n| n > 0}
|
||||||
end
|
end
|
||||||
|
|
||||||
# Updates per project notifications (after_save callback)
|
# Updates per project notifications (after_save callback)
|
||||||
|
|||||||
@ -948,6 +948,11 @@ class UserTest < ActiveSupport::TestCase
|
|||||||
assert_equal 6, User.valid_notification_options(User.find(2)).size
|
assert_equal 6, User.valid_notification_options(User.find(2)).size
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_notified_project_ids_setter_should_coerce_to_unique_integer_array
|
||||||
|
@jsmith.notified_project_ids = ["1", "123", "2u", "wrong", "12", 6, 12, -35, ""]
|
||||||
|
assert_equal [1, 123, 2, 12, 6], @jsmith.notified_projects_ids
|
||||||
|
end
|
||||||
|
|
||||||
def test_mail_notification_all
|
def test_mail_notification_all
|
||||||
@jsmith.mail_notification = 'all'
|
@jsmith.mail_notification = 'all'
|
||||||
@jsmith.notified_project_ids = []
|
@jsmith.notified_project_ids = []
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user