Commit 457d522e authored by Grzegorz Bizon's avatar Grzegorz Bizon

Merge branch 'dm-ensure-import-state-persisted-ee' into 'master'

Don't create import_state until project is persisted

See merge request gitlab-org/gitlab-ee!5612
parents 9daa737b a934a6cc
......@@ -676,9 +676,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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment