From 84b6b8bfd869a4fc91d434adca74adfb661537b2 Mon Sep 17 00:00:00 2001
From: Alan Chandler <alan@chandlerfamily.org.uk>
Date: Wed, 21 Mar 2012 08:16:41 +0000
Subject: [PATCH] Fix up changes to project so it doesn't crash on Tracker
 setup

---
 lib/tasks/migrate_from_mantis.rake |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/lib/tasks/migrate_from_mantis.rake b/lib/tasks/migrate_from_mantis.rake
index e74b879..f4d2dfd 100644
--- a/lib/tasks/migrate_from_mantis.rake
+++ b/lib/tasks/migrate_from_mantis.rake
@@ -266,13 +266,12 @@ task :migrate_from_mantis => :environment do
       categories_map = {}
       MantisProject.find(:all).each do |project|
     	p = Project.new :name => encode(project.name), 
-                        :description => encode(project.description)
+                        :description => encode(project.description),
+                        :trackers => [TRACKER_BUG,TRACKER_FEATURE]
     	p.identifier = project.identifier
-    	next unless p.save
     	projects_map[project.id] = p.id
     	p.enabled_module_names = ['issue_tracking', 'news', 'wiki']
-        p.trackers << TRACKER_BUG
-        p.trackers << TRACKER_FEATURE
+        p.save
     	print '.'
     	
     	# Project members
-- 
1.7.9.1

