diff options
author | Tiago Botelho <tiagonbotelho@hotmail.com> | 2017-06-01 17:27:35 +0300 |
---|---|---|
committer | Tiago Botelho <tiagonbotelho@hotmail.com> | 2017-06-06 01:09:10 +0300 |
commit | 810866ecb6c7be4fdac88dc3b2a6cd9ad49ac7bf (patch) | |
tree | 20c8292a1527918b71b2c099e6c49598e65d8598 /app/services/projects/create_service.rb | |
parent | f07aee72bef4604312e11a43fce3a47865bce100 (diff) |
backports changed import logic from pull mirroring feature into CE
Diffstat (limited to 'app/services/projects/create_service.rb')
-rw-r--r-- | app/services/projects/create_service.rb | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/app/services/projects/create_service.rb b/app/services/projects/create_service.rb index 535d93385e6..e874a2d8789 100644 --- a/app/services/projects/create_service.rb +++ b/app/services/projects/create_service.rb @@ -48,15 +48,14 @@ module Projects save_project_and_import_data(import_data) - @project.import_start if @project.import? - after_create_actions if @project.persisted? if @project.errors.empty? - @project.add_import_job if @project.import? + @project.import_schedule if @project.import? else fail(error: @project.errors.full_messages.join(', ')) end + @project rescue ActiveRecord::RecordInvalid => e message = "Unable to save #{e.record.type}: #{e.record.errors.full_messages.join(", ")} " |