Fix remaining linter errors
This commit is contained in:
parent
6399354b80
commit
1f6225e506
9 changed files with 28 additions and 18 deletions
|
@ -71,6 +71,7 @@ sub post_add {
|
|||
}
|
||||
);
|
||||
|
||||
## no critic (InputOutput::RequireBriefOpen)
|
||||
open my $fh, '<', \$csv_data;
|
||||
|
||||
# List context returns the actual headers
|
||||
|
@ -99,6 +100,9 @@ sub post_add {
|
|||
}
|
||||
|
||||
my $csv_output = $csv->getline_hr_all($fh);
|
||||
|
||||
close $fh;
|
||||
## use critic
|
||||
|
||||
unless ( scalar(@$csv_output) ) {
|
||||
$c->_csv_flash_error("No data found");
|
||||
|
|
|
@ -123,7 +123,7 @@ sub valid_read {
|
|||
}
|
||||
|
||||
sub valid_edit {
|
||||
my $c = shift;
|
||||
my ($c, $warning) = @_;
|
||||
|
||||
my $validation = $c->validation;
|
||||
$validation->required('name');
|
||||
|
@ -180,9 +180,9 @@ sub valid_edit {
|
|||
);
|
||||
}
|
||||
finally {
|
||||
if (@_) {
|
||||
if ($warning) {
|
||||
use Devel::Dwarn;
|
||||
Dwarn \@_;
|
||||
Dwarn \$warning;
|
||||
$c->flash(
|
||||
error => 'Something went wrong Updating the Organisation' );
|
||||
}
|
||||
|
|
|
@ -70,7 +70,7 @@ sub read {
|
|||
## no critic (Subroutines::ProhibitBuiltinHomonyms)
|
||||
sub update {
|
||||
## use critic
|
||||
my $c = shift;
|
||||
my ($c, $error) = @_;
|
||||
|
||||
my $id = $c->param('id');
|
||||
|
||||
|
@ -145,9 +145,9 @@ sub update {
|
|||
);
|
||||
}
|
||||
finally {
|
||||
if (@_) {
|
||||
if ($error) {
|
||||
$c->flash( error => 'Something went wrong Updating the User' );
|
||||
$c->app->log->warn( Dumper @_ );
|
||||
$c->app->log->warn( Dumper $error );
|
||||
}
|
||||
else {
|
||||
$c->flash( success => 'Updated User' );
|
||||
|
@ -188,9 +188,9 @@ sub update {
|
|||
);
|
||||
}
|
||||
finally {
|
||||
if (@_) {
|
||||
if ($error) {
|
||||
$c->flash( error => 'Something went wrong Updating the User' );
|
||||
$c->app->log->warn( Dumper @_ );
|
||||
$c->app->log->warn( Dumper $error );
|
||||
}
|
||||
else {
|
||||
$c->flash( success => 'Updated User' );
|
||||
|
|
Reference in a new issue