From 067d87c880d086f3f431e5f4e6599c37d5771905 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bernd=20Ble=C3=9Fmann?= Date: Mon, 20 Feb 2017 12:19:05 +0100 Subject: [PATCH] =?utf8?q?CsvImport:=20Controller=20erzeugt=20tempor=C3=A4?= =?utf8?q?res=20Profil,=20nicht=20der=20Hintergrund-Job.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- SL/BackgroundJob/CsvImport.pm | 5 ----- SL/Controller/CsvImport.pm | 5 ++++- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/SL/BackgroundJob/CsvImport.pm b/SL/BackgroundJob/CsvImport.pm index 14ad33625..1736721b9 100644 --- a/SL/BackgroundJob/CsvImport.pm +++ b/SL/BackgroundJob/CsvImport.pm @@ -14,13 +14,8 @@ sub create_job { 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, ); diff --git a/SL/Controller/CsvImport.pm b/SL/Controller/CsvImport.pm index 005fcd703..09b970300 100644 --- a/SL/Controller/CsvImport.pm +++ b/SL/Controller/CsvImport.pm @@ -359,9 +359,12 @@ sub test_and_import_deferred { 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, -- 2.20.1