]> source.dussan.org Git - redmine.git/commitdiff
Merged r12163 from trunk (#14590, #14592).
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Sun, 13 Oct 2013 08:24:48 +0000 (08:24 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Sun, 13 Oct 2013 08:24:48 +0000 (08:24 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/2.3-stable@12211 e93f8b46-1217-0410-a6f0-8f06a7374b81

lib/tasks/migrate_from_mantis.rake
lib/tasks/migrate_from_trac.rake

index 465ca99585f8b38ddd3cf79959c186d4c8ab00ce..ffa84d4ea1202fc1a40c940e0908523bd2190b40 100644 (file)
@@ -503,10 +503,20 @@ task :migrate_from_mantis => :environment do
   # Make sure bugs can refer bugs in other projects
   Setting.cross_project_issue_relations = 1 if Setting.respond_to? 'cross_project_issue_relations'
 
-  # Turn off email notifications
-  Setting.notified_events = []
+  old_notified_events = Setting.notified_events
+  old_password_min_length = Setting.password_min_length
+  begin
+    # Turn off email notifications temporarily
+    Setting.notified_events = []
+    Setting.password_min_length = 4
+    # Run the migration
+    MantisMigrate.establish_connection db_params
+    MantisMigrate.migrate
+  ensure
+    # Restore previous settings
+    Setting.notified_events = old_notified_events
+    Setting.password_min_length = old_password_min_length
+  end
 
-  MantisMigrate.establish_connection db_params
-  MantisMigrate.migrate
 end
 end
index 923b0c620e3d57d42f973aa32679282ae49989df..db36dfe0573828a242be910209db6968af8ed8d0 100644 (file)
@@ -762,10 +762,19 @@ 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
+    old_password_min_length = Setting.password_min_length
+    begin
+      # Turn off email notifications temporarily
+      Setting.notified_events = []
+      Setting.password_min_length = 4
+      # Run the migration
+      TracMigrate.migrate
+    ensure
+      # Restore previous settings
+      Setting.notified_events = old_notified_events
+      Setting.password_min_length = old_password_min_length
+    end
   end
 end