From f751112d45469757aa6eac8a540c5e298b001845 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Mon, 22 May 2017 10:15:54 +0200 Subject: [PATCH] =?utf8?q?Hintergrundjobs:=20=C2=BBSpeichern=20&=20Ausf?= =?utf8?q?=C3=BChren=C2=AB=20darf=20keinen=20neuen=20Job=20anlegen?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Siehe #256. --- SL/Controller/BackgroundJob.pm | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/SL/Controller/BackgroundJob.pm b/SL/Controller/BackgroundJob.pm index 37f2d9755..272e5cba0 100644 --- a/SL/Controller/BackgroundJob.pm +++ b/SL/Controller/BackgroundJob.pm @@ -13,13 +13,11 @@ use SL::System::TaskServer; use Rose::Object::MakeMethods::Generic ( - scalar => [ qw(background_job) ], - 'scalar --get_set_init' => [ qw(task_server back_to models) ], + 'scalar --get_set_init' => [ qw(task_server back_to models background_job) ], ); __PACKAGE__->run_before('check_auth'); __PACKAGE__->run_before('check_task_server'); -__PACKAGE__->run_before('load_background_job', only => [ qw(edit update destroy execute show) ]); # # actions @@ -149,9 +147,8 @@ sub create_or_update { $self->redirect_to($self->back_to); } -sub load_background_job { - my ($self) = @_; - $self->background_job(SL::DB::BackgroundJob->new(id => $::form->{id})->load); +sub init_background_job { + return $::form->{id} ? SL::DB::BackgroundJob->new(id => $::form->{id})->load : undef; } sub init_task_server { -- 2.20.1