@@ -504,15 +504,18 task :migrate_from_mantis => :environment do | |||||
504 | Setting.cross_project_issue_relations = 1 if Setting.respond_to? 'cross_project_issue_relations' |
|
504 | Setting.cross_project_issue_relations = 1 if Setting.respond_to? 'cross_project_issue_relations' | |
505 |
|
505 | |||
506 | old_notified_events = Setting.notified_events |
|
506 | old_notified_events = Setting.notified_events | |
|
507 | old_password_min_length = Setting.password_min_length | |||
507 | begin |
|
508 | begin | |
508 | # Turn off email notifications temporarily |
|
509 | # Turn off email notifications temporarily | |
509 | Setting.notified_events = [] |
|
510 | Setting.notified_events = [] | |
|
511 | Setting.password_min_length = 4 | |||
510 | # Run the migration |
|
512 | # Run the migration | |
511 | MantisMigrate.establish_connection db_params |
|
513 | MantisMigrate.establish_connection db_params | |
512 | MantisMigrate.migrate |
|
514 | MantisMigrate.migrate | |
513 | ensure |
|
515 | ensure | |
514 |
# Restore previous |
|
516 | # Restore previous settings | |
515 | Setting.notified_events = old_notified_events |
|
517 | Setting.notified_events = old_notified_events | |
|
518 | Setting.password_min_length = old_password_min_length | |||
516 | end |
|
519 | end | |
517 |
|
520 | |||
518 | end |
|
521 | end |
@@ -767,14 +767,17 namespace :redmine do | |||||
767 | puts |
|
767 | puts | |
768 |
|
768 | |||
769 | old_notified_events = Setting.notified_events |
|
769 | old_notified_events = Setting.notified_events | |
|
770 | old_password_min_length = Setting.password_min_length | |||
770 | begin |
|
771 | begin | |
771 | # Turn off email notifications temporarily |
|
772 | # Turn off email notifications temporarily | |
772 | Setting.notified_events = [] |
|
773 | Setting.notified_events = [] | |
|
774 | Setting.password_min_length = 4 | |||
773 | # Run the migration |
|
775 | # Run the migration | |
774 | TracMigrate.migrate |
|
776 | TracMigrate.migrate | |
775 | ensure |
|
777 | ensure | |
776 |
# Restore previous |
|
778 | # Restore previous settings | |
777 | Setting.notified_events = old_notified_events |
|
779 | Setting.notified_events = old_notified_events | |
|
780 | Setting.password_min_length = old_password_min_length | |||
778 | end |
|
781 | end | |
779 | end |
|
782 | end | |
780 | end |
|
783 | end |
General Comments 0
You need to be logged in to leave comments.
Login now