debian-mirror-gitlab/app/services/issues/import_csv_service.rb

26 lines
486 B
Ruby
Raw Normal View History

2019-02-15 15:39:39 +05:30
# frozen_string_literal: true
module Issues
2021-01-29 00:20:46 +05:30
class ImportCsvService < Issuable::ImportCsv::BaseService
2019-02-15 15:39:39 +05:30
def execute
2021-01-29 00:20:46 +05:30
record_import_attempt
2019-02-15 15:39:39 +05:30
2021-01-29 00:20:46 +05:30
super
2019-02-15 15:39:39 +05:30
end
def email_results_to_user
2020-06-23 00:09:42 +05:30
Notify.import_issues_csv_email(@user.id, @project.id, @results).deliver_later
2019-02-15 15:39:39 +05:30
end
2021-01-29 00:20:46 +05:30
private
def create_issuable_class
Issues::CreateService
end
def record_import_attempt
Issues::CsvImport.create!(user: @user, project: @project)
2019-02-15 15:39:39 +05:30
end
end
end