@@ -503,10 +503,17 task :migrate_from_mantis => :environment do | |||
|
503 | 503 | # Make sure bugs can refer bugs in other projects |
|
504 | 504 | Setting.cross_project_issue_relations = 1 if Setting.respond_to? 'cross_project_issue_relations' |
|
505 | 505 | |
|
506 | # Turn off email notifications | |
|
507 | Setting.notified_events = [] | |
|
506 | old_notified_events = Setting.notified_events | |
|
507 | begin | |
|
508 | # Turn off email notifications temporarily | |
|
509 | Setting.notified_events = [] | |
|
510 | # Run the migration | |
|
511 | MantisMigrate.establish_connection db_params | |
|
512 | MantisMigrate.migrate | |
|
513 | ensure | |
|
514 | # Restore previous notification settings even if the migration fails | |
|
515 | Setting.notified_events = old_notified_events | |
|
516 | end | |
|
508 | 517 | |
|
509 | MantisMigrate.establish_connection db_params | |
|
510 | MantisMigrate.migrate | |
|
511 | 518 | end |
|
512 | 519 | end |
@@ -762,10 +762,16 namespace :redmine do | |||
|
762 | 762 | prompt('Target project identifier') {|identifier| TracMigrate.target_project_identifier identifier} |
|
763 | 763 | puts |
|
764 | 764 | |
|
765 | # Turn off email notifications | |
|
766 | Setting.notified_events = [] | |
|
767 | ||
|
768 | TracMigrate.migrate | |
|
765 | old_notified_events = Setting.notified_events | |
|
766 | begin | |
|
767 | # Turn off email notifications temporarily | |
|
768 | Setting.notified_events = [] | |
|
769 | # Run the migration | |
|
770 | TracMigrate.migrate | |
|
771 | ensure | |
|
772 | # Restore previous notification settings even if the migration fails | |
|
773 | Setting.notified_events = old_notified_events | |
|
774 | end | |
|
769 | 775 | end |
|
770 | 776 | end |
|
771 | 777 |
General Comments 0
You need to be logged in to leave comments.
Login now