From: Jean-Philippe Lang Date: Sun, 13 Oct 2013 08:24:48 +0000 (+0000) Subject: Merged r12163 from trunk (#14590, #14592). X-Git-Tag: 2.3.4~12 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=c4eb7c380e8c62d8a37b81397d864773b7edf96e;p=redmine.git Merged r12163 from trunk (#14590, #14592). git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/2.3-stable@12211 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- diff --git a/lib/tasks/migrate_from_mantis.rake b/lib/tasks/migrate_from_mantis.rake index 465ca9958..ffa84d4ea 100644 --- a/lib/tasks/migrate_from_mantis.rake +++ b/lib/tasks/migrate_from_mantis.rake @@ -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 diff --git a/lib/tasks/migrate_from_trac.rake b/lib/tasks/migrate_from_trac.rake index 923b0c620..db36dfe05 100644 --- a/lib/tasks/migrate_from_trac.rake +++ b/lib/tasks/migrate_from_trac.rake @@ -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