summaryrefslogtreecommitdiffstats
path: root/lib/tasks/migrate_from_trac.rake
diff options
context:
space:
mode:
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