Sha256: da6ac4af4dc6e073cd158575f07051eb9c9a6382f66e87876c2ff71985113b6e

Contents?: true

Size: 1023 Bytes

Versions: 14

Compression:

Stored size: 1023 Bytes

Contents

# frozen_string_literal: true

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

      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, true)
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
decidim-admin-0.23.6 app/jobs/decidim/admin/import_participatory_space_private_user_csv_job.rb
decidim-admin-0.23.5 app/jobs/decidim/admin/import_participatory_space_private_user_csv_job.rb
decidim-admin-0.23.4 app/jobs/decidim/admin/import_participatory_space_private_user_csv_job.rb
decidim-admin-0.23.3 app/jobs/decidim/admin/import_participatory_space_private_user_csv_job.rb
decidim-admin-0.23.2 app/jobs/decidim/admin/import_participatory_space_private_user_csv_job.rb
decidim-admin-0.23.1 app/jobs/decidim/admin/import_participatory_space_private_user_csv_job.rb
decidim-admin-0.23.1.rc1 app/jobs/decidim/admin/import_participatory_space_private_user_csv_job.rb
decidim-admin-0.23.0 app/jobs/decidim/admin/import_participatory_space_private_user_csv_job.rb
decidim-admin-0.22.0 app/jobs/decidim/admin/import_participatory_space_private_user_csv_job.rb
decidim-admin-0.21.0 app/jobs/decidim/admin/import_participatory_space_private_user_csv_job.rb
decidim-admin-0.20.1 app/jobs/decidim/admin/import_participatory_space_private_user_csv_job.rb
decidim-admin-0.20.0 app/jobs/decidim/admin/import_participatory_space_private_user_csv_job.rb
decidim-admin-0.19.1 app/jobs/decidim/admin/import_participatory_space_private_user_csv_job.rb
decidim-admin-0.19.0 app/jobs/decidim/admin/import_participatory_space_private_user_csv_job.rb