Sha256: a130a12e826afdb8ff9d2a553356bd4c8a7cba27a802caf4fbeb839e7f7c1d78

Contents?: true

Size: 1.01 KB

Versions: 31

Compression:

Stored size: 1.01 KB

Contents

# frozen_string_literal: true

module Decidim
  module Admin
    # Custom ApplicationJob scoped to the admin panel.
    #
    class ImportParticipatorySpacePrivateUserCsvJob < ApplicationJob
      queue_as :exports

      def perform(email, user_name, privatable_to, current_user)
        return if email.blank? || user_name.blank?

        params = {
          name: user_name,
          email: email.downcase.strip
        }
        private_user_form = ParticipatorySpacePrivateUserForm.from_params(params, privatable_to: privatable_to)
                                                             .with_context(
                                                               current_user: current_user,
                                                               current_particiaptory_space: privatable_to
                                                             )

        Decidim::Admin::CreateParticipatorySpacePrivateUser.call(private_user_form, current_user, privatable_to, via_csv: true)
      end
    end
  end
end

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
decidim-admin-0.27.9 app/jobs/decidim/admin/import_participatory_space_private_user_csv_job.rb
decidim-admin-0.27.8 app/jobs/decidim/admin/import_participatory_space_private_user_csv_job.rb
decidim-admin-0.27.7 app/jobs/decidim/admin/import_participatory_space_private_user_csv_job.rb
decidim-admin-0.27.6 app/jobs/decidim/admin/import_participatory_space_private_user_csv_job.rb
decidim-admin-0.26.10 app/jobs/decidim/admin/import_participatory_space_private_user_csv_job.rb
decidim-admin-0.26.9 app/jobs/decidim/admin/import_participatory_space_private_user_csv_job.rb
decidim-admin-0.27.5 app/jobs/decidim/admin/import_participatory_space_private_user_csv_job.rb
decidim-admin-0.26.8 app/jobs/decidim/admin/import_participatory_space_private_user_csv_job.rb
decidim-admin-0.27.4 app/jobs/decidim/admin/import_participatory_space_private_user_csv_job.rb
decidim-admin-0.27.3 app/jobs/decidim/admin/import_participatory_space_private_user_csv_job.rb
decidim-admin-0.26.7 app/jobs/decidim/admin/import_participatory_space_private_user_csv_job.rb
decidim-admin-0.26.5 app/jobs/decidim/admin/import_participatory_space_private_user_csv_job.rb
decidim-admin-0.27.2 app/jobs/decidim/admin/import_participatory_space_private_user_csv_job.rb
decidim-admin-0.27.1 app/jobs/decidim/admin/import_participatory_space_private_user_csv_job.rb
decidim-admin-0.26.4 app/jobs/decidim/admin/import_participatory_space_private_user_csv_job.rb
decidim-admin-0.27.0 app/jobs/decidim/admin/import_participatory_space_private_user_csv_job.rb
decidim-admin-0.26.3 app/jobs/decidim/admin/import_participatory_space_private_user_csv_job.rb
decidim-admin-0.27.0.rc2 app/jobs/decidim/admin/import_participatory_space_private_user_csv_job.rb
decidim-admin-0.27.0.rc1 app/jobs/decidim/admin/import_participatory_space_private_user_csv_job.rb
decidim-admin-0.26.2 app/jobs/decidim/admin/import_participatory_space_private_user_csv_job.rb