summaryrefslogtreecommitdiffstats
path: root/lib/tasks/migrate_from_trac.rake
diff options
context:
space:
mode:
authorJean-Baptiste Barth <jeanbaptiste.barth@gmail.com>2013-05-06 20:39:03 +0000
committerJean-Baptiste Barth <jeanbaptiste.barth@gmail.com>2013-05-06 20:39:03 +0000
commit2b3111122e0a138b282cdc478e341c0774ad19ae (patch)
tree2d12bdff7a53bcc41c34eaf15b383e3623d97ac3 /lib/tasks/migrate_from_trac.rake
parentdb3b3d3a1c4ac9b51253fc0fe957a556b3499294 (diff)
downloadredmine-2b3111122e0a138b282cdc478e341c0774ad19ae.tar.gz
redmine-2b3111122e0a138b282cdc478e341c0774ad19ae.zip
Ensure Tranc and Mantis importers don't reset global notification settings (#13989).
Contributed by Brandon Valentine git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11795 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'lib/tasks/migrate_from_trac.rake')
-rw-r--r--lib/tasks/migrate_from_trac.rake14
1 files changed, 10 insertions, 4 deletions
diff --git a/lib/tasks/migrate_from_trac.rake b/lib/tasks/migrate_from_trac.rake
index 923b0c620..406a5b221 100644
--- a/lib/tasks/migrate_from_trac.rake
+++ b/lib/tasks/migrate_from_trac.rake
@@ -762,10 +762,16 @@ namespace :redmine do
prompt('Target project identifier') {|identifier| TracMigrate.target_project_identifier identifier}
puts
- # Turn off email notifications
- Setting.notified_events = []
-
- TracMigrate.migrate
+ old_notified_events = Setting.notified_events
+ begin
+ # Turn off email notifications temporarily
+ Setting.notified_events = []
+ # Run the migration
+ TracMigrate.migrate
+ ensure
+ # Restore previous notification settings even if the migration fails
+ Setting.notified_events = old_notified_events
+ end
end
end