my $package = ref($self_or_class) || $self_or_class;
$package =~ s/SL::BackgroundJob:://;
- my $profile = delete $params{profile} || SL::DB::CsvImportProfile->new;
- my $new_profile = $profile->clone_and_reset_deep;
- $new_profile->save;
-
my %data = (
%params,
- profile_id => $new_profile->id,
session_id => $::auth->get_session_id,
);
return $self->action_new;
}
+ # save tempory profile
+ $self->profile($self->profile->clone_and_reset_deep)->save;
+
$self->{background_job} = SL::BackgroundJob::CsvImport->create_job(
file => $self->csv_file_name,
- profile => $self->profile,
+ profile_id => $self->profile->id,
type => $self->profile->type,
test => $params{test},
employee_id => SL::DB::Manager::Employee->current->id,