diff options
-rw-r--r-- | app/models/project.rb | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/app/models/project.rb b/app/models/project.rb index f6ac1802846..32d34f5e9b8 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -661,9 +661,15 @@ class Project < ActiveRecord::Base return if !force && (self[:import_status] == 'none' || self[:import_status].nil?) return unless import_state.nil? - create_import_state(import_state_args) + if persisted? + create_import_state(import_state_args) - update_column(:import_status, 'none') + update_column(:import_status, 'none') + else + build_import_state(import_state_args) + + self[:import_status] = 'none' + end end def import_schedule |