],
);
-__PACKAGE__->run_before('check_auth');
+__PACKAGE__->run_before('check_auth', except => [ qw(report) ]);
__PACKAGE__->run_before('ensure_form_structure');
__PACKAGE__->run_before('check_type', except => [ qw(report) ]);
__PACKAGE__->run_before('load_all_profiles');
my $data = $self->{background_job}->data_as_hash;
my $profile = SL::DB::Manager::CsvImportProfile->find_by(id => $data->{profile_id});
-
$self->profile($profile);
if ($data->{errors} and my $first_error = $data->{errors}->[0]) {
#
sub check_auth {
- $::auth->assert('config');
+ $_[0]->check_type;
+ $_[0]->worker->check_auth;
}
sub check_type {
my $profile;
if ($::form->{profile}->{id}) {
- $profile = SL::DB::Manager::CsvImportProfile->find_by(id => $::form->{profile}->{id}, login => $::myconfig{login});
+ $profile = SL::DB::Manager::CsvImportProfile->find_by(id => $::form->{profile}->{id});
}
$profile ||= SL::DB::Manager::CsvImportProfile->find_by(type => $self->{type}, is_default => 1, login => $::myconfig{login});
$profile ||= SL::DB::CsvImportProfile->new(type => $self->{type}, login => $::myconfig{login});